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

Error with Nollup, not with Rollup #11

Closed
frederikhors opened this issue Sep 25, 2020 · 3 comments
Closed

Error with Nollup, not with Rollup #11

frederikhors opened this issue Sep 25, 2020 · 3 comments

Comments

@frederikhors
Copy link

I'm using https://github.com/pearofducks/svelte-match-media.

My setup works with npm run dev:rollup, NOT works with npm run dev (nollup).

REPRODUCTION: https://github.com/frederikhors/svelte-template-hot/tree/svelte-match-media-undefined.

I think there is everything to understand (there are few files).

If you need more, just ask, I'm here for you.

❤️

@frederikhors
Copy link
Author

A small note:

I need to use <script type='module' src='/bundle.js'></script> for Nollup.

Instead of <script type='module' src='/build/bundle.js'></script> for Rollup.

(It would be nice to fix this too.)

@frederikhors
Copy link
Author

I forgot the error:

TypeError: Cannot read property 'desktop' of undefined

@rixo
Copy link
Owner

rixo commented Sep 25, 2020

svelte-match-media relies on a live binding export, and this is not supported by Nollup... Here's why.

To have the same script source in the HTML, you can set Nollup's publicPath option, for example in the command in package.json: --public-path build (full discussion here).

Well, closing since there's nothing that can be done here... Either svelte-match-media releases a non-live-binding version for Nollup support, or Nollup should support live bindings (which they were reluctant to do until now because it's not a widely used feature and supporting it would impact Nollup's performance...).

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