Code Monkey home page Code Monkey logo

Comments (5)

MorisR avatar MorisR commented on May 22, 2024

+1
Created a new ember project + used storybook npx command to add storybook to it, and I'm getting this error

global_1.global.require is not a function
TypeError: global_1.global.require is not a function
    at loadEmberApp (http://localhost:6006/vendors-node_modules_storybook_addon-essentials_dist_actions_preview_js-node_modules_storyboo-9ecee6.iframe.bundle.js:1148:36)
    at ./node_modules/@storybook/ember/dist/client/preview/render.js (http://localhost:6006/vendors-node_modules_storybook_addon-essentials_dist_actions_preview_js-node_modules_storyboo-9ecee6.iframe.bundle.js:1155:13)
    at __webpack_require__ (http://localhost:6006/runtime~main.iframe.bundle.js:28:33)
    at fn (http://localhost:6006/runtime~main.iframe.bundle.js:313:21)
    at ./node_modules/@storybook/ember/dist/client/preview/config.js (http://localhost:6006/vendors-node_modules_storybook_addon-essentials_dist_actions_preview_js-node_modules_storyboo-9ecee6.iframe.bundle.js:1018:16)
    at __webpack_require__ (http://localhost:6006/runtime~main.iframe.bundle.js:28:33)
    at fn (http://localhost:6006/runtime~main.iframe.bundle.js:313:21)
    at PreviewWeb.getProjectAnnotations (http://localhost:6006/main.iframe.bundle.js:124:75)
    at PreviewWeb.getProjectAnnotationsOrRenderError (http://localhost:6006/sb-preview/runtime.js:129:6367)
    at PreviewWeb.initialize (http://localhost:6006/sb-preview/runtime.js:129:5672)
    ```

from storybook.

joshuabaran avatar joshuabaran commented on May 22, 2024

I get a similar error when upgrading from 6.5 to 8.

from storybook.

gossi avatar gossi commented on May 22, 2024

I think by now, ember ships with embroider build system active by default now. However, under storybook, you need to run the ember app the "classic" way with app.toTree().

If you only have one app, you can still make it possible by using an ENV var, e.g. you can start ember like so: STORYBOOK=true ember serve and in ember-cli-build.js you can detect that and run your logic. You might also run additional customizations to make your app run for storybook. Then put this in your package.json and do: pnpm start:storybook so nobody needs to remember the env var.


We have a chicken and egg... "race condition". When app v2 is defined, there might be @storybook/ember-webpack rsp @storybook/ember-vite packages for the respective loaders.

from storybook.

VincentMolinie avatar VincentMolinie commented on May 22, 2024

My app is running the classic way but I do have issue when running storybook@8 on it

from storybook.

joshuabaran avatar joshuabaran commented on May 22, 2024

For me, this error went away after adding staticDirs in my .storybook/main.js file.

from storybook.

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.