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

vite build fails #1201

Open
verschoof opened this issue Oct 5, 2024 · 1 comment
Open

vite build fails #1201

verschoof opened this issue Oct 5, 2024 · 1 comment

Comments

@verschoof
Copy link

error during build:
Could not resolve "./item" from "./item?commonjs-external"
file: ./item?commonjs-external
    at getRollupError (file:///opt/project/node_modules/rollup/dist/es/shared/parseAst.js:392:41)
    at error (file:///opt/project/node_modules/rollup/dist/es/shared/parseAst.js:388:42)
    at ModuleLoader.handleInvalidResolvedId (file:///opt/project/node_modules/rollup/dist/es/shared/node-entry.js:19273:24)
    at file:///opt/project/node_modules/rollup/dist/es/shared/node-entry.js:19233:26
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
make: *** [node] Error 1
@karlvr
Copy link

karlvr commented Jan 17, 2025

I have resolved this by patching the module locally using pnpm patch... you can achieve the same thing with patch-package.

This problem is the require('./item') in dist/masonry.pkgd.js.

diff --git a/dist/masonry.pkgd.js b/dist/masonry.pkgd.js
index 4274bfc194d4012703cb47e33cf81c96244ff092..39df9232e57ccffbe64731629792740acba41cb4 100644
--- a/dist/masonry.pkgd.js
+++ b/dist/masonry.pkgd.js
@@ -1338,7 +1338,7 @@ return Item;
         'ev-emitter/ev-emitter',
         'get-size/get-size',
         'fizzy-ui-utils/utils',
-        './item'
+        // './item'
       ],
       function( EvEmitter, getSize, utils, Item ) {
         return factory( window, EvEmitter, getSize, utils, Item);
@@ -1351,7 +1351,7 @@ return Item;
       require('ev-emitter'),
       require('get-size'),
       require('fizzy-ui-utils'),
-      require('./item')
+      // require('./item')
     );
   } else {
     // browser global

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants