Closed mnutt closed 1 year ago
I was able to circumvent this error by changing the build pipeline to output more modern javascript (via --targets="> 3%"
), though that produces backbone errors due to the use of es6 classes.
I'm not able to reproduce on my side with a fresh install, are you using the dev branch?
Yes, this is from dev HEAD (094c1ca0be13af4ba6e9b7f48e98661d60eddaf4
) as of this morning:
https://gist.github.com/mnutt/283db8bef18b7e105edd9ffbe84205ea
I was able to reproduce the same result on linux with this Dockerfile
:
FROM node:16
WORKDIR /usr/src/app
COPY package.json yarn.lock ./
RUN yarn install
COPY . .
EXPOSE 8080
CMD [ "yarn", "start" ]
docker build -t grapesjs-dev .
docker run --rm -it -p 8080:8080 grapesjs-dev
The one difference I notice on my side is the import of babel modules
modules by path ./node_modules/ 850 KiB
modules by path ./node_modules/underscore/modules/*.js 83.1 KiB 161 modules
modules by path ./node_modules/grapesjs-cli/node_modules/ 142 KiB 20 modules
modules by path ./node_modules/codemirror/ 488 KiB 5 modules
modules by path ./node_modules/@babel/runtime/helpers/esm/*.js 1.35 KiB
./node_modules/@babel/runtime/helpers/esm/defineProperty.js 344 bytes [built] [code generated]
+ 3 modules
modules by path ./node_modules/promise-polyfill/src/*.js 8.39 KiB
./node_modules/promise-polyfill/src/index.js 5.83 KiB [built] [code generated]
+ 3 modules
+ 5 modules
Not sure why your is using the whole ./node_modules/@babel/runtime/
path.
I wonder if you're able to reproduce the issue with other grapesjs related plugins that rely on the grapesjs-cli (eg. grapesjs-style-filter)
Yes, I'm able to reproduce it on grapesjs-style-filter
too, same types of errors.
@mnutt can you try with the latest grapesjs-cli version please
Sadly, the same errors with grapesjs-cli 4.0.0
😢 . And as you noticed before, it uses the whole module path:
orphan modules 501 bytes [orphan] 5 modules
modules by path ./src/ 1.49 MiB 245 modules
modules by path ./node_modules/ 918 KiB
modules by path ./node_modules/underscore/modules/*.js 83.2 KiB 161 modules
modules by path ./node_modules/grapesjs-cli/node_modules/ 180 KiB 21 modules
modules by path ./node_modules/codemirror/ 515 KiB 5 modules
modules by path ./node_modules/promise-polyfill/src/*.js 7.42 KiB
./node_modules/promise-polyfill/src/index.js 5.79 KiB [built] [code generated]
+ 2 modules
modules by path ./node_modules/@babel/runtime/helpers/esm/*.js 636 bytes
./node_modules/@babel/runtime/helpers/esm/defineProperty.js 268 bytes [built] [code generated]
./node_modules/@babel/runtime/helpers/esm/typeof.js 368 bytes [built] [code generated]
+ 5 modules
@mnutt did you try to reinstall with .lock
file and node_modules
deleted? Do you have the same issue if you run the build
command?
Ran into this issue when trying to build on a Window machine. I have not found a resolution yet. I suspect it is related to path differences on Windows vs. *nix OSs.
WARNING in ./src/common/index.ts 35:2-16
export 'default' (imported as 'Backbone') was not found in 'backbone' (module has no exports)
@ ./src/editor/view/EditorView.ts 16:0-39 45:21-22 68:2-6
@ ./src/editor/index.ts 60:0-43 866:30-40
@ ./src/index.ts 13:0-30 61:25-31
WARNING in ./src/common/index.ts 43:2-21
export 'default' (imported as 'Backbone') was not found in 'backbone' (module has no exports)
@ ./src/editor/view/EditorView.ts 16:0-39 45:21-22 68:2-6
@ ./src/editor/index.ts 60:0-43 866:30-40
@ ./src/index.ts 13:0-30 61:25-31
WARNING in ./src/common/index.ts 51:2-15
export 'default' (imported as 'Backbone') was not found in 'backbone' (module has no exports)
@ ./src/editor/view/EditorView.ts 16:0-39 45:21-22 68:2-6
@ ./src/editor/index.ts 60:0-43 866:30-40
@ ./src/index.ts 13:0-30 61:25-31
WARNING in ./src/dom_components/model/Component.ts 1597:18-45
export 'Model' (imported as 'Model') was not found in 'backbone' (module has no exports)
@ ./src/dom_components/index.ts 97:0-74 262:23-32 267:26-35 588:30-39 588:41-56
@ ./src/editor/model/Editor.ts 91:0-52 138:4-20
@ ./src/editor/index.ts 59:0-41 79:22-33
@ ./src/index.ts 13:0-30 61:25-31
WARNING in ./src/dom_components/model/Component.ts 1625:25-53
export 'Model' (imported as 'Model') was not found in 'backbone' (module has no exports)
@ ./src/dom_components/index.ts 97:0-74 262:23-32 267:26-35 588:30-39 588:41-56
@ ./src/editor/model/Editor.ts 91:0-52 138:4-20
@ ./src/editor/index.ts 59:0-41 79:22-33
@ ./src/index.ts 13:0-30 61:25-31
WARNING in ./src/editor/model/Editor.ts 113:0-10
export 'default' (imported as 'Backbone') was not found in 'backbone' (module has no exports)
@ ./src/editor/index.ts 59:0-41 79:22-33
@ ./src/index.ts 13:0-30 61:25-31
WARNING in ./src/undo_manager/index.ts 76:23-34
export 'default' (imported as 'UndoManager') was not found in 'backbone-undo' (module has no exports)
@ ./src/editor/model/Editor.ts 108:0-51 118:4-21
@ ./src/editor/index.ts 59:0-41 79:22-33
@ ./src/index.ts 13:0-30 61:25-31
GrapesJS version
What browser are you using?
Firefox 109
Reproducible demo link
none
Describe the bug
How to reproduce the bug?
What is the expected behavior?
The development server starts.
What is the current behavior?
I'm using node v16.18.1 (MacOS) although had the same result on node 14 and node 18. Is there something obvious I'm doing wrong?
Code of Conduct