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

Importing modules with "object style" exports fails #8

Open
david-nordvall opened this issue Oct 10, 2024 · 1 comment
Open

Importing modules with "object style" exports fails #8

david-nordvall opened this issue Oct 10, 2024 · 1 comment

Comments

@david-nordvall
Copy link

I'm not sure if this is an issue with parcel-transformer-svelte3-plus or with Parcel (more specifically, @parcel/resolver-default). But I'll post this issue here as a start :-).

I am unable to import modules that are exported using object style export in its package.json from my Svelte 4 applications (bundled using Parcel and parcel-transformer-svelte3-plus), such as:

{
  "export": {
    ".": {
      "types": "./dist/index.d.ts",
      "svelte": "./dist/index.js"
    }
  }
}

This fails event though I have enabled the new package exports with the following snippet in my package.json:

{
  "@parcel/resolver-default": {
    "packageExports": true
  }
}

More details and a reproduction of the error is available in the repo david-nordvall/parcel-resolver-exports-bug.

@PixievoltNo1
Copy link

This is because the Parcel resolver doesn't know to use the svelte export condition, and there's no way for you or a transformer plugin to tell it to do that. I reported it as parcel-bundler/parcel#10050.

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