Comments (7)
Any particular reason you also opened an issue with esbuild (evanw/esbuild#699)? Unless there is something clear that points to an issue within esbuild itself, it likely won't be the place to find a solution.
This sort of error hints at problems importing a svelte module. The source code, file structure and zip you included seem to be three different projects (one is using svelte-slidy, the another is svelte-slidy from what I can tell) so I'm having a hard time determining exactly where the problem is and what to look for. Some guidance here would be very helpful.
I would confirm that all the required svelte modules are being imported correctly. If you are attempting to create a node library or package, set the platform
esbuild option to 'node'
. Then, for the actual application being served to users, I would highly recommend allowing the svelte sources to be bundled (platform: 'browser'
and remove them from external
).
from esbuild-svelte.
Yes, you are right, it's not esbuild or you's plugin bug.
It's bug in svelte/internal/index.mjs file - this expression not working properly in esbuild bundle on m1 mac arm64 processor. But strange, it's working on x86 architecture 🤷🏻♂️
if you have arm64 m1 mac - you can see this issue in .zip on dev mode - npm run dev
This is screen for proposal change script with checking props. & without checking this outros it's undefined
...
from esbuild-svelte.
Interesting! I'm glad you were able to find the root source of the problem!
from esbuild-svelte.
Interesting! I'm glad you were able to find the root source of the problem!
Me too very interesting ))) how it's working with others behaviour arm64/x86 architecture 🤔
Which format you are recommend for platform browser?
from esbuild-svelte.
It's surprising that you are seeing a difference based on architecture. That shouldn't be the case. Are you sure your environments are identical?
IIFE (the default) is probably fine, that is what Evan recommends and it should see a few optimizations in the next few months
from esbuild-svelte.
Yep! Environments are identical. Only different processors.🤷🏻
from esbuild-svelte.
Tx @AlexxNB for adviced & help 👍🏻 with another solution
His fix when m1 missed svelte package path for esbuild:
function fix_svelte_path() {
return {
name: 'fix_svelte_path',
setup(b) {
const path = require('path')
b.onResolve({ filter: /^svelte$|^svelte\// }, args => {
return { path: path.join(__dirname,'node_modules',args.path,'index.mjs') }
});
}
}
}
...
plugins: [
fix_svelte_path(),
...
from esbuild-svelte.
Related Issues (20)
- Problems getting Svelte components' internal CSS styles HOT 3
- esbuild-svelte breaks watch mode on error HOT 2
- Make Svelte a peer dependency HOT 2
- dev-mode does not seem to be enabled HOT 1
- Unexpected token HOT 2
- Generate output HTML HOT 2
- cssOutputFilename not working HOT 2
- Breaks watch mode on error when preprocess dependency transformation fails HOT 5
- Example use with Typescript HOT 4
- how combine with esbuild-coffeescript ? HOT 1
- svelte: 3.53.0 ▲ [WARNING] [plugin esbuild-svelte] options.css as a boolean is deprecated. Use 'external' instead of false. HOT 2
- Option to enable svelte-check? HOT 2
- External Svelte module errors when using a Svelte import HOT 3
- Unexpected token error with latest svelte-preprocess v5 HOT 2
- Updating examples to use the 0.17.x esbuild "context API"? HOT 3
- svelte@4 - compilerOptions.css as a boolean is deprecated HOT 3
- compilerOptions css does not bundle external css files HOT 1
- Add `svelte` condition automatically
- customElement option throws an error HOT 2
- Release plugin version 1.0.0 HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esbuild-svelte.