JorgenVatle / meteor-vite

⚡ Replace Meteor's bundler with Vite for blazing fast build-times
MIT License
16 stars 5 forks source link

Blaze Support? #151

Open dallman2 opened 1 month ago

dallman2 commented 1 month ago

Hello @JorgenVatle

Does this package support Blaze as the root renderer? If so, does it support Blaze apps that also render React farther down the component tree? I would really love to use Vite for my project, but cannot easily use React at the root of the app.

Thanks, Dan

dallman2 commented 1 month ago

I tried to get my project running in the meantime, and I am getting this error:

I20240327-15:24:02.924(-7)? error on boot.js packages/modules.js:1880
I20240327-15:24:02.933(-7)? const __filename = __cjs_fileURLToPath(import.meta.url);
I20240327-15:24:02.934(-7)?       ^
I20240327-15:24:02.935(-7)? SyntaxError: Identifier '__filename' has already been declared
I20240327-15:24:02.935(-7)?     at new Script (node:vm:99:7)
I20240327-15:24:02.936(-7)?     at createScript (node:vm:255:10)
I20240327-15:24:02.936(-7)?     at Object.runInThisContext (node:vm:303:10)
I20240327-15:24:02.936(-7)?     at /tools/static-assets/server/boot.js:414:32
I20240327-15:24:02.936(-7)?     at /tools/static-assets/server/boot.js:503:13
I20240327-15:24:02.936(-7)?     at AsyncLocalStorage.run (node:async_hooks:346:14)
I20240327-15:24:02.936(-7)?     at /tools/static-assets/server/boot.js:502:37
I20240327-15:24:02.936(-7)?     at Function.run (/home/dan/repos/proj/.meteor/local/build/programs/server/tools/tool-env/profile.ts:315:14)
I20240327-15:24:02.936(-7)?     at startServerProcess (/tools/static-assets/server/boot.js:501:17)
I20240327-15:24:02.936(-7)?     at Object.<anonymous> (/tools/static-assets/server/boot.js:508:2)
=> Exited with code: 1
=> Your application is crashing. Waiting for file change.

I have created the mainModule section in package.json and the entrypoints stuff.

dallman2 commented 1 month ago

I have modified some things and have resolved the above error, I think it was due to using vite 5 instead of vite 4. Now, I am getting somewhere. In my console, I am seeing this now:

W20240327-17:58:41.460(-7)? (STDERR) ⚡  Detected multiple package definitions within lodash.isobject! Please report this to https://github.com/JorgenVatle/meteor-vite/issues
W20240327-17:58:41.461(-7)? (STDERR) ⚡  Package aldeed:collection2 was defined within lodash.isobject 🤔
W20240327-17:58:41.857(-7)? (STDERR) ⚡  Detected multiple package definitions within qs! Please report this to https://github.com/JorgenVatle/meteor-vite/issues
W20240327-17:58:41.858(-7)? (STDERR) ⚡  Package ostrio:flow-router-extra was defined within qs 🤔
W20240327-17:58:41.863(-7)? (STDERR) 
W20240327-17:58:41.863(-7)? (STDERR)  ERROR  Could not locate 'lib/index.js' in package!
W20240327-17:58:41.864(-7)? (STDERR) undefined
W20240327-17:58:41.864(-7)? (STDERR) 
W20240327-17:58:41.864(-7)? (STDERR) --[Error Stack]----------------------------------------------------------------------
W20240327-17:58:41.864(-7)? (STDERR) 
W20240327-17:58:41.864(-7)? (STDERR)  ERROR  Could not locate 'lib/index.js' in package!
W20240327-17:58:41.864(-7)? (STDERR) undefined
W20240327-17:58:41.864(-7)? (STDERR) 
W20240327-17:58:41.864(-7)? (STDERR) --[Error Stack]----------------------------------------------------------------------
W20240327-17:58:41.864(-7)? (STDERR) 
W20240327-17:58:41.864(-7)? (STDERR)  ERROR  Could not locate 'lib/index.js' in package!
W20240327-17:58:41.865(-7)? (STDERR) undefined
W20240327-17:58:41.865(-7)? (STDERR) 
W20240327-17:58:41.865(-7)? (STDERR) --[Error Stack]----------------------------------------------------------------------
W20240327-17:58:41.865(-7)? (STDERR) 
W20240327-17:58:41.865(-7)? (STDERR)  ERROR  Could not locate 'lib/index.js' in package!
W20240327-17:58:41.865(-7)? (STDERR) undefined

Any ideas?