Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: assign is not a function #3807

Closed
GozuPro opened this issue Jun 27, 2018 · 14 comments
Closed

TypeError: assign is not a function #3807

GozuPro opened this issue Jun 27, 2018 · 14 comments

Comments

@GozuPro
Copy link

GozuPro commented Jun 27, 2018

Bug or support request summary

npm run storybook fails on CRNA project because assign is not a function.
I tried to compile with node 6.0.0 or 8.3.0. Is there something I need to install to fix this issue as a global polyfill? Is it possible to use Storybook 3.0 and maybe not an alpha version?

TypeError: assign is not a function
    at Object.<anonymous> (....node_modules/@storybook/core/server.js:7:18)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:456:32)
    at tryModuleLoad (module.js:415:12)
    at Function.Module._load (module.js:407:3)
    at Module.require (module.js:466:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (...node_modules/@storybook/react-native/dist/server/config/webpack.config.js:35:15)
    at Module._compile (module.js:541:32)

Please specify which version of Storybook and optionally any affected addons that you're running

  • @storybook/react-native 4.0.0-alpha.10x.x.x
  • @storybook/addons 4.0.0-alpha.10x.x.x
@igor-dv
Copy link
Member

igor-dv commented Jun 27, 2018

Do you have a babel-runtime installed?

@GozuPro
Copy link
Author

GozuPro commented Jun 27, 2018

Thanks for your help @igor-dv but I did not. Apparently, this package is not automatically installed after create-react-native-app. That being said, after running npm install babel-runtime followed by npm run storybook, I end up with the following different error:

sh: storybook: command not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! [email protected] storybook: `storybook start -p 7007`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the [email protected] storybook script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!    .../.npm/_logs/2018-06-27T22_34_52_493Z-debug.log

In package.json, I have the following under scripts:

"scripts": {
    "start": "react-native-scripts start",
    "eject": "react-native-scripts eject",
    "android": "react-native-scripts android",
    "ios": "react-native-scripts ios",
    "test": "jest",
    "storybook": "storybook start -p 7007"
},

What's surprising for me is I'm able to do npm run start without any issue.

@DylanMay
Copy link

same issue

image
npm: v6.1.0
webpack: 4.12.2
node: v8.11.2

@igor-dv
Copy link
Member

igor-dv commented Jun 28, 2018

@GozuPro , looks like the storybook package script is wrong for you. There was a similar issue here #1726, please take a look.

Regarding the assign problem, storybook has a peer deps on babel-core and babel-runtime. please check that you have these deps installed.

@GozuPro
Copy link
Author

GozuPro commented Jun 28, 2018

@igor-dv, looks like the README.md is incomplete or the 4.0.0-alpha version isn't ready.
I started from scratch with the following:

npm i -g create-react-native-app
create-react-native-app my-project
cd my-project
npm start
npm i -g @storybook/cli
getstorybook
npm run storybook

As described, I updated App.js to contain the following: export default from './storybook';

From there, I even tried the following without success:

npm install babel-runtime
npm install babel-preset-es2015
npm install babel-preset-stage-2
npm install babel-core

What should I do because I'm losing patience on your promising package. Is someone able to create a CRNA project with Storybook version 4.0 working?

Thanks

@igor-dv
Copy link
Member

igor-dv commented Jun 28, 2018

For the alpha version you should use an alpha version of the cli as well

@stale
Copy link

stale bot commented Jul 19, 2018

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@stale stale bot added the inactive label Jul 19, 2018
@dedan
Copy link

dedan commented Jul 23, 2018

I'm having the same issue, did anyone figure out a solution?

@stale stale bot removed the inactive label Jul 23, 2018
@maggy96
Copy link

maggy96 commented Jul 25, 2018

Same here, any progress?

@dedan
Copy link

dedan commented Jul 25, 2018 via email

@stale
Copy link

stale bot commented Aug 15, 2018

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@stale stale bot added the inactive label Aug 15, 2018
@xfumihiro
Copy link

be sure to install babel-runtime v6 (instead of v7)
which is storybook depends on

@stale stale bot removed the inactive label Aug 17, 2018
@stale
Copy link

stale bot commented Sep 7, 2018

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@stale stale bot added the inactive label Sep 7, 2018
@stale
Copy link

stale bot commented Oct 7, 2018

Hey there, it's me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants