描述问题:
amis-editor-demo 使用 6.6.0版本构建,无法构建。 已经设置extensions: ['.js', '.jsx', '.ts', '.tsx','.esm.js', '.umd.js', '.min.js', '.json', '.mjs']
node 也升级到了 20版。
截图或视频:
ERROR in ./node_modules/react-pdf/dist/esm/Document.js 22:0-48
Module not found: Error: Can't resolve 'react/jsx-runtime' in 'D:\git\amis-editor-demo-master\amis-editor-demo-master\node_modules\react-pdf\dist\esm'
Did you mean 'jsx-runtime.js'?
BREAKING CHANGE: The request 'react/jsx-runtime' 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/react-pdf/dist/esm/index.js 2:0-37 13:0-128
@ ./node_modules/amis-ui/esm/components/PdfViewer.js 9:0-50 20:0-35 79:41-49 80:45-49
@ ./node_modules/amis/esm/renderers/PdfViewer.js
@ ./node_modules/amis/esm/index.js 154:0-34
@ ./src/index.tsx
ERROR in ./node_modules/react-pdf/dist/esm/Message.js 1:0-48
Module not found: Error: Can't resolve 'react/jsx-runtime' in 'D:\git\amis-editor-demo-master\amis-editor-demo-master\node_modules\react-pdf\dist\esm'
Did you mean 'jsx-runtime.js'?
BREAKING CHANGE: The request 'react/jsx-runtime' 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/react-pdf/dist/esm/Page.js 22:0-35 232:24-31 235:25-32 238:24-31
@ ./node_modules/react-pdf/dist/esm/index.js 4:0-29 13:0-128
@ ./node_modules/amis-ui/esm/components/PdfViewer.js 9:0-50 20:0-35 79:41-49 80:45-49
@ ./node_modules/amis/esm/renderers/PdfViewer.js
@ ./node_modules/amis/esm/index.js 154:0-34
@ ./src/index.tsx
ERROR in ./node_modules/react-pdf/dist/esm/Outline.js 13:0-48
Module not found: Error: Can't resolve 'react/jsx-runtime' in 'D:\git\amis-editor-demo-master\amis-editor-demo-master\node_modules\react-pdf\dist\esm'
Did you mean 'jsx-runtime.js'?
BREAKING CHANGE: The request 'react/jsx-runtime' 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/react-pdf/dist/esm/index.js 3:0-35 13:0-128
@ ./node_modules/amis-ui/esm/components/PdfViewer.js 9:0-50 20:0-35 79:41-49 80:45-49
@ ./node_modules/amis/esm/renderers/PdfViewer.js
@ ./node_modules/amis/esm/index.js 154:0-34
@ ./src/index.tsx
ERROR in ./node_modules/react-pdf/dist/esm/OutlineItem.js 21:0-63
Module not found: Error: Can't resolve 'react/jsx-runtime' in 'D:\git\amis-editor-demo-master\amis-editor-demo-master\node_modules\react-pdf\dist\esm'
Did you mean 'jsx-runtime.js'?
BREAKING CHANGE: The request 'react/jsx-runtime' 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/react-pdf/dist/esm/Outline.js 21:0-43 106:78-89
@ ./node_modules/react-pdf/dist/esm/index.js 3:0-35 13:0-128
@ ./node_modules/amis-ui/esm/components/PdfViewer.js 9:0-50 20:0-35 79:41-49 80:45-49
@ ./node_modules/amis/esm/renderers/PdfViewer.js
@ ./node_modules/amis/esm/index.js 154:0-34
@ ./src/index.tsx
ERROR in ./node_modules/react-pdf/dist/esm/Page.js 13:0-63
Module not found: Error: Can't resolve 'react/jsx-runtime' in 'D:\git\amis-editor-demo-master\amis-editor-demo-master\node_modules\react-pdf\dist\esm'
Did you mean 'jsx-runtime.js'?
BREAKING CHANGE: The request 'react/jsx-runtime' 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/react-pdf/dist/esm/index.js 4:0-29 13:0-128
@ ./node_modules/amis-ui/esm/components/PdfViewer.js 9:0-50 20:0-35 79:41-49 80:45-49
@ ./node_modules/amis/esm/renderers/PdfViewer.js
@ ./node_modules/amis/esm/index.js 154:0-34
@ ./src/index.tsx
ERROR in ./node_modules/react-pdf/dist/esm/Page/AnnotationLayer.js 2:0-48
Module not found: Error: Can't resolve 'react/jsx-runtime' in 'D:\git\amis-editor-demo-master\amis-editor-demo-master\node_modules\react-pdf\dist\esm\Page'
Did you mean 'jsx-runtime.js'?
BREAKING CHANGE: The request 'react/jsx-runtime' 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/react-pdf/dist/esm/Page.js 25:0-56 225:20-35
@ ./node_modules/react-pdf/dist/esm/index.js 4:0-29 13:0-128
@ ./node_modules/amis-ui/esm/components/PdfViewer.js 9:0-50 20:0-35 79:41-49 80:45-49
@ ./node_modules/amis/esm/renderers/PdfViewer.js
@ ./node_modules/amis/esm/index.js 154:0-34
@ ./src/index.tsx
ERROR in ./node_modules/react-pdf/dist/esm/Page/Canvas.js 2:0-48
Module not found: Error: Can't resolve 'react/jsx-runtime' in 'D:\git\amis-editor-demo-master\amis-editor-demo-master\node_modules\react-pdf\dist\esm\Page'
Did you mean 'jsx-runtime.js'?
BREAKING CHANGE: The request 'react/jsx-runtime' 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/react-pdf/dist/esm/Page.js 23:0-38 208:28-34
@ ./node_modules/react-pdf/dist/esm/index.js 4:0-29 13:0-128
@ ./node_modules/amis-ui/esm/components/PdfViewer.js 9:0-50 20:0-35 79:41-49 80:45-49
@ ./node_modules/amis/esm/renderers/PdfViewer.js
@ ./node_modules/amis/esm/index.js 154:0-34
@ ./src/index.tsx
ERROR in ./node_modules/react-pdf/dist/esm/Page/TextLayer.js 2:0-48
Module not found: Error: Can't resolve 'react/jsx-runtime' in 'D:\git\amis-editor-demo-master\amis-editor-demo-master\node_modules\react-pdf\dist\esm\Page'
Did you mean 'jsx-runtime.js'?
BREAKING CHANGE: The request 'react/jsx-runtime' 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/react-pdf/dist/esm/Page.js 24:0-44 215:20-29
@ ./node_modules/react-pdf/dist/esm/index.js 4:0-29 13:0-128
@ ./node_modules/amis-ui/esm/components/PdfViewer.js 9:0-50 20:0-35 79:41-49 80:45-49
@ ./node_modules/amis/esm/renderers/PdfViewer.js
@ ./node_modules/amis/esm/index.js 154:0-34
@ ./src/index.tsx
ERROR in ./node_modules/react-pdf/dist/esm/StructTree.js 1:0-48
Module not found: Error: Can't resolve 'react/jsx-runtime' in 'D:\git\amis-editor-demo-master\amis-editor-demo-master\node_modules\react-pdf\dist\esm'
Did you mean 'jsx-runtime.js'?
BREAKING CHANGE: The request 'react/jsx-runtime' 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/react-pdf/dist/esm/Page/Canvas.js 8:0-42 106:44-54
@ ./node_modules/react-pdf/dist/esm/Page.js 23:0-38 208:28-34
@ ./node_modules/react-pdf/dist/esm/index.js 4:0-29 13:0-128
@ ./node_modules/amis-ui/esm/components/PdfViewer.js 9:0-50 20:0-35 79:41-49 80:45-49
@ ./node_modules/amis/esm/renderers/PdfViewer.js
@ ./node_modules/amis/esm/index.js 154:0-34
@ ./src/index.tsx
ERROR in ./node_modules/react-pdf/dist/esm/StructTreeItem.js 1:0-48
Module not found: Error: Can't resolve 'react/jsx-runtime' in 'D:\git\amis-editor-demo-master\amis-editor-demo-master\node_modules\react-pdf\dist\esm'
Did you mean 'jsx-runtime.js'?
BREAKING CHANGE: The request 'react/jsx-runtime' 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/react-pdf/dist/esm/StructTree.js 6:0-49 76:16-30
@ ./node_modules/react-pdf/dist/esm/Page/Canvas.js 8:0-42 106:44-54
@ ./node_modules/react-pdf/dist/esm/Page.js 23:0-38 208:28-34
@ ./node_modules/react-pdf/dist/esm/index.js 4:0-29 13:0-128
@ ./node_modules/amis-ui/esm/components/PdfViewer.js 9:0-50 20:0-35 79:41-49 80:45-49
@ ./node_modules/amis/esm/renderers/PdfViewer.js
@ ./node_modules/amis/esm/index.js 154:0-34
@ ./src/index.tsx
ERROR in ./node_modules/react-pdf/dist/esm/Thumbnail.js 13:0-48
Module not found: Error: Can't resolve 'react/jsx-runtime' in 'D:\git\amis-editor-demo-master\amis-editor-demo-master\node_modules\react-pdf\dist\esm'
Did you mean 'jsx-runtime.js'?
BREAKING CHANGE: The request 'react/jsx-runtime' 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/react-pdf/dist/esm/index.js 5:0-39 13:0-128
@ ./node_modules/amis-ui/esm/components/PdfViewer.js 9:0-50 20:0-35 79:41-49 80:45-49
@ ./node_modules/amis/esm/renderers/PdfViewer.js
@ ./node_modules/amis/esm/index.js 154:0-34
@ ./src/index.tsx
11 errors have detailed information that is not shown.
Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.
如何复现(请务必完整填写下面内容):
- 你是如何使用 amis 的?
npm - amis 版本是什么?请先在最新 beta 版本测试问题是否存在
6.6.0 - 粘贴有问题的完整
amis schema
代码:
code here...
- 操作步骤
请简单描述一下复现的操作步骤...
2条答案
按热度按时间ymdaylpp1#
amis-editor-demo 能否更新一下,目前是6.0.0 。 总有bug
bakd9h0s2#
月底 6.7.0 解决