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

dotenv-webpack missing #7641

Closed
revmischa opened this issue Jul 31, 2019 · 19 comments
Closed

dotenv-webpack missing #7641

revmischa opened this issue Jul 31, 2019 · 19 comments

Comments

@revmischa
Copy link

I upgraded to the latest @storybook/core and @storybook/react
and now get:

info @storybook/react v5.2.0-beta.19
info 
info => Loading static files from: /Users/cyber/dev/jb/qc/qc-frontend/public .
info => Loading presets
WARN   Failed to load preset: "/Users/cyber/dev/jb/qc/qc-frontend/node_modules/@storybook/react/node_modules/@storybook/core/dist/server/manager/manager-preset.js"
ERR! Error: Cannot find module 'dotenv-webpack'
ERR! Require stack:
ERR! - /Users/cyber/dev/jb/qc/qc-frontend/node_modules/@storybook/react/node_modules/@storybook/core/dist/server/manager/manager-webpack.config.js
ERR! - /Users/cyber/dev/jb/qc/qc-frontend/node_modules/@storybook/react/node_modules/@storybook/core/dist/server/manager/manager-preset.js
ERR! - /Users/cyber/dev/jb/qc/qc-frontend/node_modules/@storybook/react/node_modules/@storybook/core/dist/server/presets.js
ERR! - /Users/cyber/dev/jb/qc/qc-frontend/node_modules/@storybook/react/node_modules/@storybook/core/dist/server/config.js
ERR! - /Users/cyber/dev/jb/qc/qc-frontend/node_modules/@storybook/react/node_modules/@storybook/core/dist/server/build-static.js
ERR! - /Users/cyber/dev/jb/qc/qc-frontend/node_modules/@storybook/react/node_modules/@storybook/core/server.js
ERR! - /Users/cyber/dev/jb/qc/qc-frontend/node_modules/@storybook/react/dist/server/index.js
ERR! - /Users/cyber/dev/jb/qc/qc-frontend/node_modules/@storybook/react/bin/index.js
ERR!     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:625:15)
ERR!     at Function.Module._load (internal/modules/cjs/loader.js:527:27)
ERR!     at Module.require (internal/modules/cjs/loader.js:683:19)
ERR!     at require (internal/modules/cjs/helpers.js:16:16)
ERR!     at Object.<anonymous> (/Users/cyber/dev/jb/qc/qc-frontend/node_modules/@storybook/react/node_modules/@storybook/core/dist/server/manager/manager-webpack.config.js:14:45)
ERR!     at Module._compile (internal/modules/cjs/loader.js:776:30)
ERR!     at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
ERR!     at Module.load (internal/modules/cjs/loader.js:643:32)
ERR!     at Function.Module._load (internal/modules/cjs/loader.js:556:12)
ERR!     at Module.require (internal/modules/cjs/loader.js:683:19)
ERR!     at require (internal/modules/cjs/helpers.js:16:16)
ERR!     at Object.<anonymous> (/Users/cyber/dev/jb/qc/qc-frontend/node_modules/@storybook/react/node_modules/@storybook/core/dist/server/manager/manager-preset.js:21:46)
ERR!     at Module._compile (internal/modules/cjs/loader.js:776:30)
ERR!     at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
ERR!     at Module.load (internal/modules/cjs/loader.js:643:32)
ERR!     at Function.Module._load (internal/modules/cjs/loader.js:556:12)
ERR!  Error: Cannot find module 'dotenv-webpack'
@revmischa
Copy link
Author

and if install it, it yells at me i don't have raw-loader
if i install that too, it runs like before except for the error
TS2305: Module '"../../../../../../../../Users/cyber/dev/jb/qc/qc-frontend/node_modules/@storybook/react/dist/client"' has no exported member 'RenderFunction'.

@revmischa
Copy link
Author

ModuleNotFoundError: Module not found: Error: Can't resolve 'react-resize-detector' in '/Users/cyber/dev/jb/qc/qc-frontend/node_modules/@storybook/react/node_modules/@storybook/ui/dist'

@revmischa
Copy link
Author

And after getting it to start up I get the error
return api.configure.apply(api, args.concat([framework]));


(anonymous) @ vendors~main.12b2a6f84f7c5f7e11bc.bundle.js:585
index.js:37 Uncaught TypeError: Cannot read property 'apply' of undefined
    at configure (index.js:37)
    at Module.<anonymous> (config.js:8)
    at Module../.storybook/config.js (config.js:8)
    at __webpack_require__ (bootstrap:785)
    at fn (bootstrap:150)
    at Object.0 (storybookThemeDecorator.tsx:28)
    at __webpack_require__ (bootstrap:785)
    at checkDeferredModules (bootstrap:45)
    at Array.webpackJsonpCallback [as push] (bootstrap:32)
    at main.45c52f6220ccb7b0328b.bundle.js:1

@stale
Copy link

stale bot commented Aug 21, 2019

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!

@shilman
Copy link
Member

shilman commented Aug 22, 2019

Sorry I missed this the first time around. Are you still seeing this in the latest beta?

@stale
Copy link

stale bot commented Sep 12, 2019

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 12, 2019
@wKich
Copy link
Member

wKich commented Sep 16, 2019

@shilman, hello. I updated on latest stable 5.2.0 and receive type checking error

node_modules/@storybook/react/dist/client/preview/index.d.ts:2:23 - error TS2688: Cannot find type definition file for 'webpack-env'.

2 /// <reference types="webpack-env" />

Do I need explicitly install webpack-env?

@stale stale bot removed the inactive label Sep 16, 2019
@uyarn
Copy link

uyarn commented Sep 16, 2019

Sorry I missed this the first time around. Are you still seeing this in the latest beta?
@shilman Hi, I upgrade @storybook/react from 5.1.x to 5.2.0 and I use typescript.I got this error "has no exported member 'RenderFunction' ";May I ask you did you fix this problem and which version can I use now?

@revmischa
Copy link
Author

I experienced this unpleasantness as well @uyarn - I tried import { StoryFn } from '@storybook/addons' and it seemed to work

@uyarn
Copy link

uyarn commented Sep 16, 2019

I experienced this unpleasantness as well @uyarn - I tried import { StoryFn } from '@storybook/addons' and it seemed to work

@revmischa Hi revmischa, did you just add this line of code into your project? and which file did you add?

@revmischa
Copy link
Author

yes in my custom wrapper addon

@uyarn
Copy link

uyarn commented Sep 16, 2019

yes in my custom wrapper addon

Thank you @revmischa , I'll try it and hope it can be fixed throughly :), Cheers.

@ndelangen
Copy link
Member

@kroeder I'm looking at:

node_modules/@storybook/react/dist/client/preview/index.d.ts:2:23 - error TS2688: Cannot find type definition file for 'webpack-env'.

2 /// <reference types="webpack-env" />

And the output does reference webpack-env, but the package does not depend on it at all. Should it?

This is true for a LOT of packages actually.

@stale
Copy link

stale bot commented Oct 15, 2019

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 Oct 15, 2019
@kroeder
Copy link
Member

kroeder commented Oct 15, 2019

In app/angular it was due to tsconfig "types=[webpack-env]"

I assume it was added because in one server file module.hot or something like that is accessed. It shows a TSLint error because it uses node instead of webpack.env module. I fixed it by casting module to any in this file and removed webpack-env from the tsconfig

@stale stale bot removed the inactive label Oct 15, 2019
@stale
Copy link

stale bot commented Nov 5, 2019

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 Nov 5, 2019
@stale
Copy link

stale bot commented Dec 5, 2019

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!

@stale stale bot closed this as completed Dec 5, 2019
@futbolsalas15
Copy link

Hi!

It seems the error persists even with version 6.0.22

$ C:\project\node_modules\.bin\start-storybook --loglevel info
info @storybook/angular v6.0.22
info
info => Loading presets
WARN   Failed to load preset: "C:\\project\\node_modules\\@storybook\\angular\\node_modules\\@storybook\\core\\dist\\server\\manager\\manager-preset.js"
ERR! Error: Cannot find module 'dotenv-webpack'
ERR!     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
ERR!     at Function.Module._load (internal/modules/cjs/loader.js:562:25)
ERR!     at Module.require (internal/modules/cjs/loader.js:692:17)
ERR!     at require (internal/modules/cjs/helpers.js:25:18)
ERR!     at Object.<anonymous> (C:\project\node_modules\@storybook\angular\node_modules\@storybook\core\dist\server\manager\manager-webpack.config.js:20:45)

I've tried to install the required package, but it seems to continue requiring more packages.

Analyzing the content of @storybook/core folder inside node_modules, it seems that it has its own version of node_modules, where the package is available. Maybe it is an error where the local node_modules inside @storybook/core isn't being included in the build process?

@ndelangen
Copy link
Member

@futbolsalas15 if you can provide a clean reproduction repo, I can take a look.

I suspect it's a lockfile issue, try removing all lockfiles, node_modules and re-installing.
See if it works then.

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

7 participants