ofhouse / storybook-stencil-example

Example project which uses Stencil components in Storybook.
https://ofhouse.github.io/storybook-stencil-example
MIT License
12 stars 6 forks source link

Command line error when running cloned project on Windows. #1

Open paulfelton opened 4 years ago

paulfelton commented 4 years ago

I clone, install, build and run, and while it works in the browser, I get the following error in the console:

"Error: ENOENT: no such file or directory, stat 'D:\MyWebsites\components\storybook-stencil-example\node_modules\@storybook\core\dist\public\storybook-stencil-example\storybook-stencil-example.js'"

Windows 10. VScode. Gitbash Capture

ofhouse commented 4 years ago

Hi and thanks for reaching out! Just tested it locally on my Windows machine and did't get the error you described. The path of the missing module is built here: https://github.com/ofhouse/storybook-stencil-example/blob/4e59aa56b9c87147eb5c3c0d200b3770e2308fa6/.storybook/main.js#L17 So i guess something is wrong with __dirname here.

However I've changed it in the current master from __dirname to process.cwd() which may fix the problem for now. Can you please pull the new changes and try it out?

paulfelton commented 4 years ago

I'm afraid that hasn't helped. I get the same error.

I've added some logging in and I can see projectDir looks correct, as does the result of path.join(projectDir, OUTPUT_DIR, ${PROJECT_NAME}.js)

ofhouse commented 4 years ago

Ok, checked again and the last thing which had no absolute path was the context from the Webpack copy plugin here: https://github.com/ofhouse/storybook-stencil-example/blob/4e59aa56b9c87147eb5c3c0d200b3770e2308fa6/.storybook/main.js#L53 I've changed it in master branch so that it also uses an absolute path now.

If this does not help can you provide me the node version (type node --version in the console) you are using?

paulfelton commented 4 years ago

Hi again. I'm afraid that still hasn't resolved it. I'm getting the same message. I've tried logging OUTPUT_DIR again, this time from the webpack file and again, it looks correct.

I'm using node v12.13.0.

Also, just observed that while Storybook launches with the MyButton and MyComponent, there's no knobs or actions available - wonder if that's connected?