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

unpic-svelte cause Vite ReferenceError: exports is not defined with style-object-to-css-string pacakge #216

Open
matiasfha opened this issue May 12, 2023 · 0 comments

Comments

@matiasfha
Copy link

Describe the bug
I'm buiding a component library, one of the component use unpic-svelte
After successfully packaging the library with sveltekit package mode I try to use it locally through pnpm link

When running the application that will use the component library I gest this

[vite] Error when evaluating SSR module /@fs/Users/matias/Development/MyLibrary/node_modules/.pnpm/@unpic+svelte@0.0.22_svelte@3.58.0/node_modules/@unpic/svelte/dist/image.svelte: failed to import "/@fs/Users/matias/Development/MyLibrary/node_modules/.pnpm/style-object-to-css-string@1.0.1/node_modules/style-object-to-css-string/dist/index.js"
|- ReferenceError: exports is not defined
    at eval (/@fs/Users/matias/Development/MyLibrary/node_modules/.pnpm/style-object-to-css-string@1.0.1/node_modules/style-object-to-css-string/dist/index.js:5:23)
    at instantiateModule (file:///Users/matias/Development/MyLibrary/node_modules/.pnpm/vite@4.3.4/node_modules/vite/dist/node/chunks/dep-f7d05e3f.js:54346:15)

To Reproduce
Steps to reproduce the behavior:

  1. Crea a fresh sveltekit app
  2. Install unpic-svelte
  3. Create a component inside src/lib/components/MyImage.svelte that uses unpic
  4. run pnpm package
  5. Create another svelkit app.
  6. run pnpm link <path-to-the-original-project>
  7. import the package into the new app
  8. run the new app

Expected behavior
The component imported from the "source" app should work correctly.

Screenshots

Desktop (please complete the following information):

  • OS: Macos
  • Browser chrome, safari, Arc
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

1 participant