DTStack / molecule

:rocket: A lightweight Web IDE UI framework.
https://dtstack.github.io/molecule/
Other
884 stars 127 forks source link

The molecule-demo demo is not working correctly. #570

Closed SQLGate closed 2 years ago

SQLGate commented 2 years ago

Describe the bug The molecule-demo demo is not working correctly.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'https://dtstack.github.io/molecule/docs/quick-start'
  2. npx create-react-app molecule-demo --template typescript
  3. cd molecule-demo
  4. yarn add @dtinsight/molecule
  5. Create js file to src/App.js
  6. yarn start

Screenshots image

Desktop (please complete the following information):

Development Environment

Additional context Below is the error code.

Compiled with problems:X

ERROR in ./node_modules/@dtinsight/molecule/esm/components/tabs/dragAndDrop.js 5:19-35

export 'createDndContext' (imported as 'createDndContext') was not found in 'react-dnd' (module has no exports)

ERROR in ./node_modules/@dtinsight/molecule/esm/components/tabs/dragAndDrop.js 12:29-40

export 'DndProvider' (imported as 'DndProvider') was not found in 'react-dnd' (module has no exports)

ERROR in ./node_modules/@dtinsight/molecule/esm/components/tabs/tab.js 50:19-26

export 'useDrag' (imported as 'useDrag') was not found in 'react-dnd' (module has no exports)

ERROR in ./node_modules/@dtinsight/molecule/esm/components/tabs/tab.js 59:19-26

export 'useDrop' (imported as 'useDrop') was not found in 'react-dnd' (module has no exports)

ERROR in ./node_modules/react-dnd-html5-backend/dist/esm/index.js 1:0-42

Module not found: Error: Can't resolve './HTML5Backend' in 'D:\Dev\Javascript\molecule-demo\node_modules\react-dnd-html5-backend\dist\esm'
Did you mean 'HTML5Backend.js'?
BREAKING CHANGE: The request './HTML5Backend' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.

ERROR in ./node_modules/react-dnd-html5-backend/dist/esm/index.js 2:0-45

Module not found: Error: Can't resolve './NativeTypes' in 'D:\Dev\Javascript\molecule-demo\node_modules\react-dnd-html5-backend\dist\esm'
Did you mean 'NativeTypes.js'?
BREAKING CHANGE: The request './NativeTypes' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.

ERROR in ./node_modules/react-dnd-html5-backend/dist/esm/index.js 3:0-48

Module not found: Error: Can't resolve './getEmptyImage' in 'D:\Dev\Javascript\molecule-demo\node_modules\react-dnd-html5-backend\dist\esm'
Did you mean 'getEmptyImage.js'?
BREAKING CHANGE: The request './getEmptyImage' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.

ERROR in ./node_modules/react-dnd/dist/esm/index.js 1:0-25

Module not found: Error: Can't resolve './common' in 'D:\Dev\Javascript\molecule-demo\node_modules\react-dnd\dist\esm'
Did you mean 'index.js'?
BREAKING CHANGE: The request './common' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.

ERROR in ./node_modules/react-dnd/dist/esm/index.js 2:0-24

Module not found: Error: Can't resolve './hooks' in 'D:\Dev\Javascript\molecule-demo\node_modules\react-dnd\dist\esm'
Did you mean 'index.js'?
BREAKING CHANGE: The request './hooks' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.

ERROR in ./node_modules/react-dnd/dist/esm/index.js 3:0-29

Module not found: Error: Can't resolve './decorators' in 'D:\Dev\Javascript\molecule-demo\node_modules\react-dnd\dist\esm'
Did you mean 'index.js'?
BREAKING CHANGE: The request './decorators' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
D:\Dev\Javascript\molecule-demo>yarn start
yarn run v1.22.17
$ react-scripts start
(node:13184) [DEP_WEBPACK_DEV_SERVER_ON_AFTER_SETUP_MIDDLEWARE] DeprecationWarning: 'onAfterSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:13184) [DEP_WEBPACK_DEV_SERVER_ON_BEFORE_SETUP_MIDDLEWARE] DeprecationWarning: 'onBeforeSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
Starting the development server...
Failed to compile.

Attempted import error: 'createDndContext' is not exported from 'react-dnd' (imported as 'createDndContext').
assets by path static/js/*.js 14.9 MiB
  assets by chunk 678 KiB (id hint: vendors) 19 assets
  63 assets
asset static/media/codicon.59002d8cc9a0e78be5b7.ttf 66.6 KiB [emitted] [immutable] [from: node_modules/monaco-editor/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf] (auxiliary name: main)
asset asset-manifest.json 29.1 KiB [emitted]
asset index.html 1.67 KiB [emitted]
1597 modules

WARNING in ./node_modules/monaco-editor/esm/vs/base/browser/dompurify/dompurify.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from 'D:\Dev\Javascript\molecule-demo\node_modules\monaco-editor\esm\vs\base\browser\dompurify\purify.es.js.map' file: Error: ENOENT: no such file or directory, open 'D:\Dev\Javascript\molecule-demo\node_modules\monaco-editor\esm\vs\base\browser\dompurify\purify.es.js.map'
 @ ./node_modules/monaco-editor/esm/vs/base/browser/markdownRenderer.js 6:0-54 300:2-19 319:2-19 333:11-29 337:4-24 338:4-24
 @ ./node_modules/monaco-editor/esm/vs/editor/browser/core/markdownRenderer.js 53:0-75 90:37-51
 @ ./node_modules/monaco-editor/esm/vs/editor/contrib/hover/modesGlyphHover.js 9:0-74 91:48-64
 @ ./node_modules/monaco-editor/esm/vs/editor/contrib/hover/hover.js 27:0-61 128:36-60 135:36-60 176:36-60 200:32-53
 @ ./node_modules/monaco-editor/esm/vs/editor/editor.all.js 30:0-34
 @ ./node_modules/@dtinsight/molecule/esm/monaco/index.js 9:0-48
 @ ./node_modules/@dtinsight/molecule/esm/services/theme/colorThemeService.js 19:0-56 100:6-30 101:6-27
 @ ./node_modules/@dtinsight/molecule/esm/services/index.js 1:0-42 1:0-42
 @ ./node_modules/@dtinsight/molecule/esm/molecule.api.js 11:0-27 11:0-27 14:0-320 25:40-53 30:45-63 31:42-57 32:44-61 33:44-61 34:40-53 35:41-55 36:41-55 37:40-53 38:43-59 39:39-51 40:46-65 41:42-57 46:44-61 51:42-57 52:41-55 57:43-59
 @ ./node_modules/@dtinsight/molecule/esm/index.js 1:0-43 4:0-20 5:15-23
 @ ./src/App.js 5:0-66 10:30-46 12:35-44
 @ ./src/index.tsx 7:0-24 11:33-36

1 warning has detailed information that is not shown.
Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.

ERROR in ./node_modules/@dtinsight/molecule/esm/components/tabs/dragAndDrop.js 5:19-35
export 'createDndContext' (imported as 'createDndContext') was not found in 'react-dnd' (module has no exports)
 @ ./node_modules/@dtinsight/molecule/esm/components/tabs/index.js 6:0-40 54:29-40
 @ ./node_modules/@dtinsight/molecule/esm/components/index.js 18:0-30 18:0-30
 @ ./node_modules/@dtinsight/molecule/esm/molecule.api.js 7:0-44 8:0-36
 @ ./node_modules/@dtinsight/molecule/esm/index.js 1:0-43 4:0-20 5:15-23
 @ ./src/App.js 5:0-66 10:30-46 12:35-44
 @ ./src/index.tsx 7:0-24 11:33-36

ERROR in ./node_modules/@dtinsight/molecule/esm/components/tabs/dragAndDrop.js 12:29-40
export 'DndProvider' (imported as 'DndProvider') was not found in 'react-dnd' (module has no exports)
 @ ./node_modules/@dtinsight/molecule/esm/components/tabs/index.js 6:0-40 54:29-40
 @ ./node_modules/@dtinsight/molecule/esm/components/index.js 18:0-30 18:0-30
 @ ./node_modules/@dtinsight/molecule/esm/molecule.api.js 7:0-44 8:0-36
 @ ./node_modules/@dtinsight/molecule/esm/index.js 1:0-43 4:0-20 5:15-23
 @ ./src/App.js 5:0-66 10:30-46 12:35-44
 @ ./src/index.tsx 7:0-24 11:33-36

ERROR in ./node_modules/@dtinsight/molecule/esm/components/tabs/tab.js 50:19-26
export 'useDrag' (imported as 'useDrag') was not found in 'react-dnd' (module has no exports)
 @ ./node_modules/@dtinsight/molecule/esm/components/index.js 19:0-33 19:0-33
 @ ./node_modules/@dtinsight/molecule/esm/molecule.api.js 7:0-44 8:0-36
 @ ./node_modules/@dtinsight/molecule/esm/index.js 1:0-43 4:0-20 5:15-23
 @ ./src/App.js 5:0-66 10:30-46 12:35-44
 @ ./src/index.tsx 7:0-24 11:33-36

ERROR in ./node_modules/@dtinsight/molecule/esm/components/tabs/tab.js 59:19-26
export 'useDrop' (imported as 'useDrop') was not found in 'react-dnd' (module has no exports)
 @ ./node_modules/@dtinsight/molecule/esm/components/index.js 19:0-33 19:0-33
 @ ./node_modules/@dtinsight/molecule/esm/molecule.api.js 7:0-44 8:0-36
 @ ./node_modules/@dtinsight/molecule/esm/index.js 1:0-43 4:0-20 5:15-23
 @ ./src/App.js 5:0-66 10:30-46 12:35-44
 @ ./src/index.tsx 7:0-24 11:33-36

ERROR in ./node_modules/react-dnd-html5-backend/dist/esm/index.js 1:0-42
Module not found: Error: Can't resolve './HTML5Backend' in 'D:\Dev\Javascript\molecule-demo\node_modules\react-dnd-html5-backend\dist\esm'
Did you mean 'HTML5Backend.js'?
BREAKING CHANGE: The request './HTML5Backend' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
 @ ./node_modules/@dtinsight/molecule/esm/components/tabs/dragAndDrop.js 3:0-51 5:36-48
 @ ./node_modules/@dtinsight/molecule/esm/components/tabs/index.js 6:0-40 54:29-40
 @ ./node_modules/@dtinsight/molecule/esm/components/index.js 18:0-30 18:0-30
 @ ./node_modules/@dtinsight/molecule/esm/molecule.api.js 7:0-44 8:0-36
 @ ./node_modules/@dtinsight/molecule/esm/index.js 1:0-43 4:0-20 5:15-23
 @ ./src/App.js 5:0-66 10:30-46 12:35-44
 @ ./src/index.tsx 7:0-24 11:33-36

ERROR in ./node_modules/react-dnd-html5-backend/dist/esm/index.js 2:0-45
Module not found: Error: Can't resolve './NativeTypes' in 'D:\Dev\Javascript\molecule-demo\node_modules\react-dnd-html5-backend\dist\esm'
Did you mean 'NativeTypes.js'?
BREAKING CHANGE: The request './NativeTypes' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
 @ ./node_modules/@dtinsight/molecule/esm/components/tabs/dragAndDrop.js 3:0-51 5:36-48
 @ ./node_modules/@dtinsight/molecule/esm/components/tabs/index.js 6:0-40 54:29-40
 @ ./node_modules/@dtinsight/molecule/esm/components/index.js 18:0-30 18:0-30
 @ ./node_modules/@dtinsight/molecule/esm/molecule.api.js 7:0-44 8:0-36
 @ ./node_modules/@dtinsight/molecule/esm/index.js 1:0-43 4:0-20 5:15-23
 @ ./src/App.js 5:0-66 10:30-46 12:35-44
 @ ./src/index.tsx 7:0-24 11:33-36

ERROR in ./node_modules/react-dnd-html5-backend/dist/esm/index.js 3:0-48
Module not found: Error: Can't resolve './getEmptyImage' in 'D:\Dev\Javascript\molecule-demo\node_modules\react-dnd-html5-backend\dist\esm'
Did you mean 'getEmptyImage.js'?
BREAKING CHANGE: The request './getEmptyImage' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
 @ ./node_modules/@dtinsight/molecule/esm/components/tabs/dragAndDrop.js 3:0-51 5:36-48
 @ ./node_modules/@dtinsight/molecule/esm/components/tabs/index.js 6:0-40 54:29-40
 @ ./node_modules/@dtinsight/molecule/esm/components/index.js 18:0-30 18:0-30
 @ ./node_modules/@dtinsight/molecule/esm/molecule.api.js 7:0-44 8:0-36
 @ ./node_modules/@dtinsight/molecule/esm/index.js 1:0-43 4:0-20 5:15-23
 @ ./src/App.js 5:0-66 10:30-46 12:35-44
 @ ./src/index.tsx 7:0-24 11:33-36

ERROR in ./node_modules/react-dnd/dist/esm/index.js 1:0-25
Module not found: Error: Can't resolve './common' in 'D:\Dev\Javascript\molecule-demo\node_modules\react-dnd\dist\esm'
Did you mean 'index.js'?
BREAKING CHANGE: The request './common' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
 @ ./node_modules/@dtinsight/molecule/esm/components/tabs/tab.js 15:0-45 50:19-26 59:19-26
 @ ./node_modules/@dtinsight/molecule/esm/components/index.js 19:0-33 19:0-33
 @ ./node_modules/@dtinsight/molecule/esm/molecule.api.js 7:0-44 8:0-36
 @ ./node_modules/@dtinsight/molecule/esm/index.js 1:0-43 4:0-20 5:15-23
 @ ./src/App.js 5:0-66 10:30-46 12:35-44
 @ ./src/index.tsx 7:0-24 11:33-36

ERROR in ./node_modules/react-dnd/dist/esm/index.js 2:0-24
Module not found: Error: Can't resolve './hooks' in 'D:\Dev\Javascript\molecule-demo\node_modules\react-dnd\dist\esm'
Did you mean 'index.js'?
BREAKING CHANGE: The request './hooks' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
 @ ./node_modules/@dtinsight/molecule/esm/components/tabs/tab.js 15:0-45 50:19-26 59:19-26
 @ ./node_modules/@dtinsight/molecule/esm/components/index.js 19:0-33 19:0-33
 @ ./node_modules/@dtinsight/molecule/esm/molecule.api.js 7:0-44 8:0-36
 @ ./node_modules/@dtinsight/molecule/esm/index.js 1:0-43 4:0-20 5:15-23
 @ ./src/App.js 5:0-66 10:30-46 12:35-44
 @ ./src/index.tsx 7:0-24 11:33-36

ERROR in ./node_modules/react-dnd/dist/esm/index.js 3:0-29
Module not found: Error: Can't resolve './decorators' in 'D:\Dev\Javascript\molecule-demo\node_modules\react-dnd\dist\esm'
Did you mean 'index.js'?
BREAKING CHANGE: The request './decorators' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
 @ ./node_modules/@dtinsight/molecule/esm/components/tabs/tab.js 15:0-45 50:19-26 59:19-26
 @ ./node_modules/@dtinsight/molecule/esm/components/index.js 19:0-33 19:0-33
 @ ./node_modules/@dtinsight/molecule/esm/molecule.api.js 7:0-44 8:0-36
 @ ./node_modules/@dtinsight/molecule/esm/index.js 1:0-43 4:0-20 5:15-23
 @ ./src/App.js 5:0-66 10:30-46 12:35-44
 @ ./src/index.tsx 7:0-24 11:33-36

6 errors have detailed information that is not shown.
Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.

webpack 5.65.0 compiled with 10 errors and 1 warning in 46316 ms
No issues found.

Hope this helps you solve the problem.

D:\Dev\Javascript\molecule-demo>yarn add @dtinsight/molecule
yarn add v1.22.17
info No lockfile found.
[1/4] Resolving packages...
warning @dtinsight/molecule > react-split-pane > styled-components > fbjs > core-js@1.2.7: core-js@<3.4 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning "@dtinsight/molecule > rc-textarea@0.3.6" has unmet peer dependency "react@>=16.9.0".
warning "@dtinsight/molecule > rc-textarea@0.3.6" has unmet peer dependency "react-dom@>=16.9.0".
warning "@dtinsight/molecule > rc-util@5.5.1" has unmet peer dependency "react@>=16.9.0".
warning "@dtinsight/molecule > rc-util@5.5.1" has unmet peer dependency "react-dom@>=16.9.0".
warning "@dtinsight/molecule > rc-textarea > rc-util@5.16.1" has unmet peer dependency "react@>=16.9.0".
warning "@dtinsight/molecule > rc-textarea > rc-util@5.16.1" has unmet peer dependency "react-dom@>=16.9.0".
warning "@dtinsight/molecule > rc-dialog@8.2.1" has unmet peer dependency "react@^16.0.0".
warning "@dtinsight/molecule > rc-dialog@8.2.1" has unmet peer dependency "react-dom@^16.0.0".
warning "@dtinsight/molecule > rc-tooltip@5.1.1" has unmet peer dependency "react@>=16.9.0".
warning "@dtinsight/molecule > rc-tooltip@5.1.1" has unmet peer dependency "react-dom@>=16.9.0".
warning "@dtinsight/molecule > react-dnd@9.5.1" has unmet peer dependency "react@>= 16.8".
warning "@dtinsight/molecule > react-dnd@9.5.1" has unmet peer dependency "react-dom@>= 16.8".
warning "@dtinsight/molecule > rc-textarea > rc-resize-observer@1.1.2" has unmet peer dependency "react@>=16.9.0".
warning "@dtinsight/molecule > rc-textarea > rc-resize-observer@1.1.2" has unmet peer dependency "react-dom@>=16.9.0".
warning "@dtinsight/molecule > react-scrollbars-custom@4.0.27" has unmet peer dependency "react@>=16.0.0".
warning "@dtinsight/molecule > react-scrollbars-custom > react-draggable@4.4.4" has unmet peer dependency "react@>= 16.3.0".
warning "@dtinsight/molecule > react-scrollbars-custom > react-draggable@4.4.4" has unmet peer dependency "react-dom@>= 16.3.0".
warning "@dtinsight/molecule > rc-tooltip > rc-trigger@5.2.10" has unmet peer dependency "react@>=16.9.0".
warning "@dtinsight/molecule > rc-tooltip > rc-trigger@5.2.10" has unmet peer dependency "react-dom@>=16.9.0".
warning "@dtinsight/molecule > rc-tooltip > rc-trigger > rc-align@4.0.11" has unmet peer dependency "react@>=16.9.0".
warning "@dtinsight/molecule > rc-tooltip > rc-trigger > rc-align@4.0.11" has unmet peer dependency "react-dom@>=16.9.0".
warning "@dtinsight/molecule > rc-tooltip > rc-trigger > rc-motion@2.4.4" has unmet peer dependency "react@>=16.9.0".
warning "@dtinsight/molecule > rc-tooltip > rc-trigger > rc-motion@2.4.4" has unmet peer dependency "react-dom@>=16.9.0".
warning " > @dtinsight/molecule@0.9.0-beta.1.1" has unmet peer dependency "react@^16.14.0".
warning " > @dtinsight/molecule@0.9.0-beta.1.1" has unmet peer dependency "react-dom@^16.14.0".
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 213 new dependencies.
info Direct dependencies
└─ @dtinsight/molecule@0.9.0-beta.1.1
info All dependencies
├─ @ant-design/css-animation@1.7.3
├─ @babel/code-frame@7.16.0
├─ @babel/helper-validator-identifier@7.15.7
├─ @babel/highlight@7.16.0
├─ @babel/runtime@7.16.5
├─ @dtinsight/dt-utils@1.1.0
├─ @dtinsight/molecule@0.9.0-beta.1.1
├─ @hutson/parse-repository-url@3.0.2
├─ @types/asap@2.0.0
├─ @types/hoist-non-react-statics@3.3.1
├─ @types/invariant@2.2.35
├─ @types/minimist@1.2.2
├─ @types/normalize-package-data@2.4.1
├─ @types/prop-types@15.7.4
├─ @types/react-dom@17.0.11
├─ @types/scheduler@0.16.2
├─ @types/shallowequal@1.1.1
├─ @vscode/codicons@0.0.26
├─ add-dom-event-listener@1.1.0
├─ add-stream@1.0.0
├─ ansi-regex@5.0.1
├─ ansi-styles@3.2.1
├─ array-ify@1.0.0
├─ arrify@1.0.1
├─ asap@2.0.6
├─ balanced-match@1.0.2
├─ base64-js@1.5.1
├─ brace-expansion@1.1.11
├─ brcast@3.0.2
├─ buffer-from@1.1.2
├─ buffer@5.7.1
├─ camelcase-keys@6.2.2
├─ camelcase@5.3.1
├─ camelize@1.0.0
├─ chalk@2.4.2
├─ cliui@7.0.4
├─ clsx@1.1.1
├─ cnbuilder@2.7.1
├─ color-convert@1.9.3
├─ color-name@1.1.3
├─ concat-map@0.0.1
├─ concat-stream@2.0.0
├─ conventional-changelog-angular@5.0.13
├─ conventional-changelog-atom@2.0.8
├─ conventional-changelog-codemirror@2.0.8
├─ conventional-changelog-config-spec@2.1.0
├─ conventional-changelog-conventionalcommits@4.6.1
├─ conventional-changelog-core@4.2.4
├─ conventional-changelog-ember@2.0.9
├─ conventional-changelog-eslint@3.0.9
├─ conventional-changelog-express@2.0.6
├─ conventional-changelog-jquery@3.0.11
├─ conventional-changelog-jshint@2.0.9
├─ conventional-changelog-writer@5.0.0
├─ conventional-changelog@3.1.24
├─ conventional-recommended-bump@6.1.0
├─ core-js@1.2.7
├─ core-util-is@1.0.3
├─ css-color-keywords@1.0.0
├─ css-to-react-native@2.3.2
├─ csstype@3.0.10
├─ dargs@7.0.0
├─ dayjs@1.10.7
├─ decamelize-keys@1.1.0
├─ decamelize@1.2.0
├─ detect-indent@6.1.0
├─ detect-newline@3.1.0
├─ dom-align@1.12.2
├─ dot-prop@5.3.0
├─ dotgitignore@2.1.0
├─ emoji-regex@8.0.0
├─ encoding@0.1.13
├─ escalade@3.1.1
├─ fast-memoize@2.5.2
├─ fbjs@0.8.18
├─ figures@3.2.0
├─ find-up@5.0.0
├─ fs-access@1.0.1
├─ function-bind@1.1.1
├─ get-caller-file@2.0.5
├─ get-pkg-repo@4.2.1
├─ git-remote-origin-url@2.0.0
├─ gitconfiglocal@1.0.0
├─ glamor@2.20.40
├─ glamorous@4.13.1
├─ graceful-fs@4.2.8
├─ handlebars@4.7.7
├─ hard-rejection@2.1.0
├─ has-flag@1.0.0
├─ has@1.0.3
├─ hosted-git-info@4.0.2
├─ html-element-attributes@1.3.1
├─ html-tag-names@1.1.5
├─ hyphenate-style-name@1.0.4
├─ iconv-lite@0.6.3
├─ ieee754@1.2.1
├─ immutability-helper@3.1.1
├─ indent-string@4.0.0
├─ inherits@2.0.4
├─ ini@1.3.8
├─ inline-style-prefixer@4.0.2
├─ invariant@2.2.4
├─ is-arrayish@0.2.1
├─ is-core-module@2.8.0
├─ is-fullwidth-code-point@3.0.0
├─ is-function@1.0.2
├─ is-obj@2.0.0
├─ is-plain-obj@1.1.0
├─ is-plain-object@2.0.4
├─ is-stream@1.1.0
├─ is-text-path@1.0.1
├─ isarray@1.0.0
├─ isomorphic-fetch@2.2.1
├─ js-tokens@4.0.0
├─ json-parse-better-errors@1.0.2
├─ json-parse-even-better-errors@2.3.1
├─ json-stringify-safe@5.0.1
├─ jsonparse@1.3.1
├─ JSONStream@1.3.5
├─ kind-of@6.0.3
├─ lines-and-columns@1.2.4
├─ load-json-file@4.0.0
├─ locate-path@6.0.0
├─ lodash.ismatch@4.4.0
├─ map-obj@1.0.1
├─ min-indent@1.0.1
├─ minimatch@3.0.4
├─ minimist-options@4.1.0
├─ minimist@1.2.5
├─ modify-values@1.0.1
├─ monaco-editor@0.30.1
├─ neo-async@2.6.2
├─ node-fetch@1.7.3
├─ normalize-package-data@2.5.0
├─ normalize.css@7.0.0
├─ null-check@1.0.0
├─ p-limit@2.3.0
├─ p-locate@5.0.0
├─ p-try@2.2.0
├─ parse-json@4.0.0
├─ path-parse@1.0.7
├─ path-type@3.0.0
├─ performance-now@2.1.0
├─ postcss-value-parser@3.3.1
├─ process-nextick-args@2.0.1
├─ promise@7.3.1
├─ quick-lru@4.0.1
├─ raf@3.4.1
├─ rc-align@4.0.11
├─ rc-animate@3.1.1
├─ rc-dialog@8.2.1
├─ rc-motion@2.4.4
├─ rc-resize-observer@1.1.2
├─ rc-textarea@0.3.6
├─ rc-tooltip@5.1.1
├─ rc-trigger@5.2.10
├─ rc-util@5.16.1
├─ react-dnd-html5-backend@9.5.1
├─ react-dnd@9.5.1
├─ react-dom@16.14.0
├─ react-draggable@4.4.4
├─ react-html-attributes@1.4.6
├─ react-is@16.13.1
├─ react-lifecycles-compat@3.0.4
├─ react-scrollbars-custom@4.0.27
├─ react-split-pane@2.0.3
├─ react@16.14.0
├─ read-pkg-up@3.0.0
├─ readable-stream@3.6.0
├─ redent@3.0.0
├─ redux@4.1.2
├─ reflect-metadata@0.1.13
├─ regenerator-runtime@0.13.9
├─ require-directory@2.1.1
├─ resolve@1.20.0
├─ safe-buffer@5.1.2
├─ safer-buffer@2.1.2
├─ scheduler@0.19.1
├─ setimmediate@1.0.5
├─ source-map@0.6.1
├─ spdx-correct@3.1.1
├─ spdx-exceptions@2.3.0
├─ split@1.0.1
├─ standard-version@9.3.2
├─ string_decoder@1.3.0
├─ string-width@4.2.3
├─ stringify-package@1.0.1
├─ strip-bom@3.0.0
├─ strip-indent@3.0.0
├─ styled-components@2.4.1
├─ stylis@3.5.4
├─ supports-color@3.2.3
├─ svg-tag-names@1.1.2
├─ text-extensions@1.9.0
├─ through@2.3.8
├─ trim-newlines@3.0.1
├─ tslib@1.14.1
├─ tsyringe@4.5.0
├─ type-fest@0.18.1
├─ typedarray@0.0.6
├─ ua-parser-js@0.7.31
├─ uglify-js@3.14.5
├─ util-deprecate@1.0.2
├─ whatwg-fetch@3.6.2
├─ wordwrap@1.0.0
├─ wrap-ansi@7.0.0
├─ xtend@4.0.2
├─ y18n@5.0.8
├─ yallist@4.0.0
├─ yargs-parser@20.2.9
├─ yargs@16.2.0
├─ yocto-queue@0.1.0
└─ zoom-level@2.5.0
Done in 15.01s.

D:\Dev\Javascript>
SQLGate commented 2 years ago

I have this problem and all of the computers I have have the same error. (Desktop(Windows 11), MacBook Pro and My Windows Notebook)

wewoor commented 2 years ago

I have this problem and all of the computers I have have the same error. (Desktop(Windows 11), MacBook Pro and My Windows Notebook)

Ok, let's confirm this problem

SQLGate commented 2 years ago

What's problem ?

wewoor commented 2 years ago

What's problem ?

In progress~

wewoor commented 2 years ago

What's problem?

Hi, @SQLGate, I have resolved the problem.

Reason

There need to add a module rule in Webpack configs, because the react-dnd indicates thetype: 'module' in package.json, Refer to: https://webpack.js.org/api/module-methods/ https://webpack.js.org/configuration/module/#resolvefullyspecified

Resolve

So, I customized the config in the config-overrides:

module.exports = function override(config, env) {
    //do stuff with the webpack config...

    config.module.rules.push({
        test: /\.m?jsx?$/,
        resolve: {
          fullySpecified: false
        },
    });

    return config;
}

How to customize the create-react-app project could use the react-app-rewired

SQLGate commented 2 years ago

Thanks @wewoor I worked according to your opinion, and it worked However, it was very difficult for me as I lack skills in React. Will your opinion be the basis for creating a molecule-demo? Or is there a better way?

I'll attach the code I wrote first.

Create molecule-demo

> npx create-react-app molecule-demo --template typescript
> cd molecule-demo
> npm install @dtinsight/molecule

Install react-app-rewired

> npm install react-app-rewired --save-dev

Create a config-overrides.js file in the root directory

module.exports = function override(config, env) {
    //do stuff with the webpack config...

    config.module.rules.push({
        test: /\.m?jsx?$/,
        resolve: {
          fullySpecified: false
        },
    });

    return config;
}
+-- your-project
|   +-- config-overrides.js
|   +-- node_modules
|   +-- package.json
|   +-- public
|   +-- README.md
|   +-- src

'Flip' the existing calls to react-scripts in npm scripts for start, build and test in package.json

  /* package.json */

  "scripts": {
-   "start": "react-scripts start",
+   "start": "react-app-rewired start",
-   "build": "react-scripts build",
+   "build": "react-app-rewired build",
-   "test": "react-scripts test",
+   "test": "react-app-rewired test",
    "eject": "react-scripts eject"
}

Create the src/App.js file and replace the file contents with the following.

import React from 'react';
import { MoleculeProvider, Workbench } from '@dtinsight/molecule';
import '@dtinsight/molecule/esm/style/mo.css';

function App() {
    return (
        <MoleculeProvider extensions={[]}>
            <Workbench />
        </MoleculeProvider>
    );
}

export default App;

Start command

> yarn start
jackqqxu commented 2 years ago

Thanks @wewoor I worked according to your opinion, and it worked However, it was very difficult for me as I lack skills in React. Will your opinion be the basis for creating a molecule-demo? Or is there a better way?

I'll attach the code I wrote first.

Create molecule-demo

> npx create-react-app molecule-demo --template typescript
> cd molecule-demo
> npm install @dtinsight/molecule

Install react-app-rewired

> npm install react-app-rewired --save-dev

Create a config-overrides.js file in the root directory

module.exports = function override(config, env) {
    //do stuff with the webpack config...

    config.module.rules.push({
        test: /\.m?jsx?$/,
        resolve: {
          fullySpecified: false
        },
    });

    return config;
}
+-- your-project
|   +-- config-overrides.js
|   +-- node_modules
|   +-- package.json
|   +-- public
|   +-- README.md
|   +-- src

'Flip' the existing calls to react-scripts in npm scripts for start, build and test in package.json

  /* package.json */

  "scripts": {
-   "start": "react-scripts start",
+   "start": "react-app-rewired start",
-   "build": "react-scripts build",
+   "build": "react-app-rewired build",
-   "test": "react-scripts test",
+   "test": "react-app-rewired test",
    "eject": "react-scripts eject"
}

Create the src/App.js file and replace the file contents with the following.

import React from 'react';
import { MoleculeProvider, Workbench } from '@dtinsight/molecule';
import '@dtinsight/molecule/esm/style/mo.css';

function App() {
    return (
        <MoleculeProvider extensions={[]}>
            <Workbench />
        </MoleculeProvider>
    );
}

export default App;

Start command

> yarn start

it works!