Version
@nuxtjs/storybook: 4.1.1
nuxt: 2.15.7
Reproduction Link
The repository ftsell/BorrowList300 includes two tagged commits.
The first is at a state in which storybook fails to compile while the second has a workaround commit applied.
Steps to reproduce
-
Add a server-only-plugin that really only compiles when loaded on the server.
In my case this is a plugin responsible for hosting the project's backend because it requires modules for the database layer that are not available for the browser.
This plugin should import its dependencies at the top of the file before checking whether it is executing in a server context.
This is fine during normal nuxt execution because nuxt only includes the plugin in the server bundle.
-
Try to start nuxt storybook
What is Expected?
nuxt storybook should start just as well as the normal nuxt server does.
What is actually happening?
In my case nuxt storybook exits with 'Nuxt Fatal error' and a huge stack trace because it cannot bundle a module that was compile using node-gyp.
Version
@nuxtjs/storybook: 4.1.1
nuxt: 2.15.7
Reproduction Link
The repository ftsell/BorrowList300 includes two tagged commits.
The first is at a state in which storybook fails to compile while the second has a workaround commit applied.
Steps to reproduce
Add a server-only-plugin that really only compiles when loaded on the server.
In my case this is a plugin responsible for hosting the project's backend because it requires modules for the database layer that are not available for the browser.
This plugin should import its dependencies at the top of the file before checking whether it is executing in a server context.
This is fine during normal nuxt execution because nuxt only includes the plugin in the server bundle.
Try to start
nuxt storybookWhat is Expected?
nuxt storybookshould start just as well as the normal nuxt server does.What is actually happening?
In my case
nuxt storybookexits with 'Nuxt Fatal error' and a huge stack trace because it cannot bundle a module that was compile usingnode-gyp.