Describe the bug
When i run command docz dev i got error Cannot find module 'fork-ts-checker-webpack-plugin'
internal/modules/cjs/loader.js:611
throw err;
^
Error: Cannot find module 'fork-ts-checker-webpack-plugin'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:609:15)
at Function.Module._load (internal/modules/cjs/loader.js:535:25)
at Module.require (internal/modules/cjs/loader.js:663:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (C:\dashboard-ui-kit\node_modules\react-dev-utils\WebpackDevServerUtils.js:21:36)
at Module._compile (internal/modules/cjs/loader.js:734:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:745:10)
at Module.load (internal/modules/cjs/loader.js:626:32)
at tryModuleLoad (internal/modules/cjs/loader.js:566:12)
at Function.Module._load (internal/modules/cjs/loader.js:558:3)
at Module.require (internal/modules/cjs/loader.js:663:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (C:\dashboard-ui-kit\node_modules\docz-core\dist\index.js:1:2125)
at Module._compile (internal/modules/cjs/loader.js:734:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:745:10)
at Module.load (internal/modules/cjs/loader.js:626:32)
Environment
Do you use create-react-app? If so, check if you use the newest version of react-scripts by checking if the package.json lists "react-scripts": "2.1.4"
If you're not using create-react-app, try updating webpack to the newest version
If you're not using
create-react-app, try updatingwebpackto the newest version
"webpack": "^4.29.3",
"webpack-cli": "^3.2.3"
What is actually needed to create a docz app? The "Getting Started" section mentions only that one should install docz and docz-theme-default and add script commands. However, then I'm getting this Cannot find module 'fork-ts-checker-webpack-plugin' error. Should I use create-react-app or add webpack manually?
i installed fork-ts-checker-webpack-plugin, but now i got this error Cannot find module 'typescript' WHAT? WHY NEED TS ?
I'm experiencing this same behavior. My dependencies have only contained docz and react up until now.
"devDependencies": {
"docz": "0.13.7",
"docz-theme-default": "0.13.7",
},
"dependencies": {
"prop-types": "15.6.2",
"react": "16.7.0",
"react-dom": "16.7.0"
}
I'm guessing one or more docz dependencies were updated due to the ^ rules ?
I have the same issue after regenerating my yarn.lock.
Locked dependencies without the error here: https://github.com/hastebrot/react-playground/blob/ce9b59e00766ce95bb9a98f97cc2f34bbd30929e/packages/demo-docz-site/yarn.lock
@pedronauck ?
Looks like this is resolved, I tried creating a new project this morning and did not get this error.
yarn add docz docz-theme-default --dev
yarn docz dev
@popuguytheparrot, try removing your yarn.lock file and reinstalling your dependencies.
@cdonohue
Now i have this error
✓ Creating app... 1 ms
{ parser: "babylon" } is deprecated; we now treat it as { parser: "babel" }.
â ™ Parsing mdx files
✓ Parsing mdx files 101 ms
✓ Starting your server 0 ms
â ™ Initializing data server
â ¹ Initializing data server
â ¸ Initializing data server
✓ Initializing data server 340 ms
i Compiling Client webpackbar 10:32:53
√ Client: Compiled with some errors in 5.31s webpackbar 10:32:58
ERROR Failed to compile with 1 errors10:32:58
error in ./node_modules/docz/dist/index.m.js
Module parse failed: Unexpected token (473:30)
You may need an appropriate loader to handle this file type.
| async function loadFromImports(path) {
| // tslint:disable-next-line
> const { imports } = await import('~imports');
| const { default: Component$$1, getInitialData } = await imports[path]();
| const ExportedComponent = props => (createElement(AsyncComponent, Object.assign({}, props, { as: Component$$1 || 'div', getInitialData: getInitialData })));
@ ./node_modules/docz-theme-default/dist/index.m.js 39:0-72 243:12-16 374:35-39 466:34-45 467:8-12 511:25-29 552:50-54 640:16-27 643:41-45 942:20-24 1024:28-39 1098:16-27 1490:33-44 1601:16-27 1872:16-27 1935:29-40 2029:45-56 2040:25-36 2041:8-18 2073:16-21
@ ./.docz/app/root.jsx
@ ./.docz/app/index.jsx
@ multi ./node_modules/react-dev-utils/webpackHotDevClient.js ./node_modules/@babel/polyfill/lib/index.js ./.docz/app/index.jsx
Failed to compile.
./node_modules/docz/dist/index.m.js 473:30
Module parse failed: Unexpected token (473:30)
You may need an appropriate loader to handle this file type.
| async function loadFromImports(path) {
| // tslint:disable-next-line
> const { imports } = await import('~imports');
| const { default: Component$$1, getInitialData } = await imports[path]();
| const ExportedComponent = props => (createElement(AsyncComponent, Object.assign({}, props, { as: Component$$1 || 'div', getInitialData: getInitialData })));
WAIT Compiling...10:32:58
Compiling...
i Compiling Client webpackbar 10:32:59
√ Client: Compiled with some errors in 1.51s webpackbar 10:33:00
ERROR Failed to compile with 1 errors10:33:00
error in ./node_modules/docz/dist/index.m.js
Module parse failed: Unexpected token (473:30)
You may need an appropriate loader to handle this file type.
| async function loadFromImports(path) {
| // tslint:disable-next-line
> const { imports } = await import('~imports');
| const { default: Component$$1, getInitialData } = await imports[path]();
| const ExportedComponent = props => (createElement(AsyncComponent, Object.assign({}, props, { as: Component$$1 || 'div', getInitialData: getInitialData })));
@ ./node_modules/docz-theme-default/dist/index.m.js 39:0-72 243:12-16 374:35-39 466:34-45 467:8-12 511:25-29 552:50-54 640:16-27 643:41-45 942:20-24 1024:28-39 1098:16-27 1490:33-44 1601:16-27 1872:16-27 1935:29-40 2029:45-56 2040:25-36 2041:8-18 2073:16-21
@ ./.docz/app/root.jsx
@ ./.docz/app/index.jsx
@ multi ./node_modules/react-dev-utils/webpackHotDevClient.js ./node_modules/@babel/polyfill/lib/index.js ./.docz/app/index.jsx
Failed to compile.
./node_modules/docz/dist/index.m.js 473:30
Module parse failed: Unexpected token (473:30)
You may need an appropriate loader to handle this file type.
| async function loadFromImports(path) {
| // tslint:disable-next-line
> const { imports } = await import('~imports');
| const { default: Component$$1, getInitialData } = await imports[path]();
| const ExportedComponent = props => (createElement(AsyncComponent, Object.assign({}, props, { as: Component$$1 || 'div', getInitialData: getInitialData })));
@rakannimer why a u close issue ?
Hey,
Sorry for the inconvenience, but this issue affects versions of docz older than v2.
The small team maintaining docz doesn't have the bandwidth to simultaneously maintain and enhance multiple versions.
So we're closing older issues to better keep track and try to solve bugs that are still happening.
Could you try upgrading to docz@next ? If you face any problems in the process, please open a new issue and the community can help !
Most helpful comment
Looks like this is resolved, I tried creating a new project this morning and did not get this error.
@popuguytheparrot, try removing your
yarn.lockfile and reinstalling your dependencies.