GithubHelp home page GithubHelp logo

Comments (13)

alexboateng avatar alexboateng commented on May 7, 2024 12

In react applications with SSR and can be used by Lazy loading the component and disable SSR

import dynamic from "next/dynamic";

const DynamicComponentWithNoSSR = dynamic(() => import("../components/Stories"), {
  ssr: false,
});

export default () => <DynamicComponentWithNoSSR />;

from react-insta-stories.

prafulrajhm avatar prafulrajhm commented on May 7, 2024 1

Any solution for this?

I am facing same issue when I am using in Next.JS

from react-insta-stories.

AbdeenM avatar AbdeenM commented on May 7, 2024

Most probably this library is meant for reactjs web applications not react native. what a shame, just realized this after installing it and getting this error too

from react-insta-stories.

mohitk05 avatar mohitk05 commented on May 7, 2024

Yes, this is meant to be used in React application, but even for server rendered apps this error would show up because the final build contains window object. The reason is style-loader including window into the final build (webpack-contrib/style-loader#109). One solution could be not importing styles until component is mounted. There are few solutions mentioned on this issue, we can implement one of these.

from react-insta-stories.

iMerica avatar iMerica commented on May 7, 2024

Thanks for working on this project. I've forked it and switched to isomorphic-style-loader to render this component server-side in Next.js.

I would love to submit a pull request, but the way you structured this project is very unusual. Normally, I'm able to fork a repo, make an enhancement on my fork and update my package.json to point to my personal Github fork. But that doesn't work because the root package.json doesn't have an entrypoint. (see #64)

Please consider moving packages/react-native-stories to a separate github repo and move packages/react-insta-stories/* to the root of this repo.

from react-insta-stories.

iMerica avatar iMerica commented on May 7, 2024

Upon further investigation, it appears that this package is not being built properly. There are no actual build dependencies in the package.json.

"dependencies": {}

You appear to be packaging the devDependencies into the final build that is being published to NPM. Nothing in this package requires window or document.

from react-insta-stories.

federicoromandemo avatar federicoromandemo commented on May 7, 2024

Any solution for this?

I am facing same issue when I am using in Next.JS

I am facing the same problem with Expo.

from react-insta-stories.

prafulrajhm avatar prafulrajhm commented on May 7, 2024

Any solution for this?
I am facing same issue when I am using in Next.JS

I am facing the same problem with Expo.

@xelahaippa solution worked for me, I created a component using <DynamicComponentWithNoSSR />

from react-insta-stories.

KishanGujarati avatar KishanGujarati commented on May 7, 2024

any update on this??

I am facing same issue when I am using in Next.JS

from react-insta-stories.

cbasJS avatar cbasJS commented on May 7, 2024

I had the same issue!!

I resolved using @loadable/component module.

// Packages
import React from 'react'
import loadable from '@loadable/component'

// Components
import Layout from '../../components/Layout'

// Loadable components
const BeerStoryContent = loadable(() => import('../../components/BeerStoryContent'))

const ContainerComponent = () => {
  return (
   <Layout><BeerStoryContent /></Layout>
 )
}

export default ContainerComponent

from react-insta-stories.

Manishbatra4 avatar Manishbatra4 commented on May 7, 2024

@prafulrajhm can you show how I am facing same problem in nextjs

from react-insta-stories.

cbasJS avatar cbasJS commented on May 7, 2024

@prafulrajhm can you show how I am facing same problem in nextjs

I really recommend you try using @loadable/component

Iยดm using Gatsby JS and this module is working perfectly for me =)

from react-insta-stories.

mohitk05 avatar mohitk05 commented on May 7, 2024

The module can now be loaded without any helper package. The fix has been added in v2.2.2!

from react-insta-stories.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.