Skip to content

Conversation

CShigaki
Copy link

For some reason the plugin breaks with the following error message when running on Windows:

> @stencil/[email protected] dev.example E:\coding\storybook
> pnpm --filter example run storybook


> [email protected] storybook E:\coding\storybook\packages\example
> storybook dev -p 6006 --no-open

storybook v9.0.5

WARN You are currently using Storybook 9.0.5 but you have packages which are incompatible with it:
WARN - @stencil/[email protected] which depends on ^9.0.8
WARN  Repo: https://github.com/stenciljs/storybook
WARN
WARN
WARN Please consider updating your packages or contacting the maintainers for compatibility details.
WARN For more on Storybook 9 compatibility, see the linked GitHub issue:
WARN https://github.com/storybookjs/storybook/issues/30944
SB_CORE-SERVER_0002 (CriticalPresetLoadError): Storybook failed to load the following preset: @stencil\storybook-plugin\preset.

Please check whether your setup is correct, the Storybook dependencies (and their peer dependencies) are installed correctly and there are no package version clashes.

If you believe this is a bug, please open an issue on Github.

ReferenceError: require is not defined in ES module scope, you can use import instead
This file is being treated as an ES module because it has a '.js' file extension and 'E:\coding\storybook\packages\plugin\package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.
    at file:///E:/coding/storybook/packages/plugin/dist/preset.js:1:46
    at ModuleJobSync.runSync (node:internal/modules/esm/module_job:450:37)
    at ModuleLoader.importSyncForRequire (node:internal/modules/esm/loader:429:47)
    at loadESMFromCJS (node:internal/modules/cjs/loader:1519:24)
    at Module._compile (node:internal/modules/cjs/loader:1670:5)
    at Module._compile (E:\coding\storybook\node_modules\.pnpm\[email protected][email protected]\node_modules\esbuild-register\dist\node.js:2258:26)
    at node:internal/modules/cjs/loader:1820:10
    at Object.newLoader (E:\coding\storybook\node_modules\.pnpm\[email protected][email protected]\node_modules\esbuild-register\dist\node.js:2262:9)
    at extensions..js (E:\coding\storybook\node_modules\.pnpm\[email protected][email protected]\node_modules\esbuild-register\dist\node.js:4833:24)
    at Module.load (node:internal/modules/cjs/loader:1423:32)

More info:

    at loadPreset (E:\coding\storybook\node_modules\.pnpm\[email protected]_@[email protected][email protected]\node_modules\storybook\dist\common\index.cjs:23583:13)

WARN Broken build, fix the error above.
WARN You may need to refresh the browser.

I've managed to get it working without any issues using WSL tho.

I was getting a more specific error on my company's pc, pointing exactly to the __dirname const but sadly I can't interact with outside repos.
Changing the const name fixes the problem

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant