Giter Club home page Giter Club logo

Comments (7)

EMH333 avatar EMH333 commented on June 6, 2024

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.

Valexr avatar Valexr commented on June 6, 2024

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...

91680814-7dc59800-eb1a-11ea-8698-16aba1aeba67

from esbuild-svelte.

EMH333 avatar EMH333 commented on June 6, 2024

Interesting! I'm glad you were able to find the root source of the problem!

from esbuild-svelte.

Valexr avatar Valexr commented on June 6, 2024

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.

EMH333 avatar EMH333 commented on June 6, 2024

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.

Valexr avatar Valexr commented on June 6, 2024

Yep! Environments are identical. Only different processors.🤷🏻

from esbuild-svelte.

Valexr avatar Valexr commented on June 6, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.