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

Some module dependencies not found by in memory filesystem #2

Open
antony opened this issue Feb 28, 2020 · 4 comments
Open

Some module dependencies not found by in memory filesystem #2

antony opened this issue Feb 28, 2020 · 4 comments

Comments

@antony
Copy link

antony commented Feb 28, 2020

I'm trying to add HMR support to my existing Sapper apps. Aside from the warnings about named exports which I'm assuming don't factor in to this, it looks like the hmr filesystem is lacking some of my node_modules which it requires.

The error I'm getting is:

ENOENT: no such file or directory, open '/home/ant/Projects/beyonk-pwa/__sapper__/dev/client/@hot/node_modules/@beyonk/gdpr-cookie-consent-banner/dist/style.css'
(node:24456) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open '/home/ant/Projects/beyonk-pwa/__sapper__/dev/client/@hot/node_modules/@beyonk/gdpr-cookie-consent-banner/dist/style.css'
    at Object.openSync (fs.js:456:3)
    at Object.writeFileSync (fs.js:1297:35)
    at /home/ant/Projects/beyonk-pwa/node_modules/sapper/dist/core.js:491:6
    at Array.forEach (<anonymous>)
    at extract_css (/home/ant/Projects/beyonk-pwa/node_modules/sapper/dist/core.js:469:23)
    at RollupResult.to_json (/home/ant/Projects/beyonk-pwa/node_modules/sapper/dist/core.js:696:9)
    at handle_result (/home/ant/Projects/beyonk-pwa/node_modules/sapper/dist/dev.js:333:28)
    at /home/ant/Projects/beyonk-pwa/node_modules/sapper/dist/dev.js:427:5
    at Object.<anonymous> (/home/ant/Projects/beyonk-pwa/node_modules/sapper/dist/core.js:832:6)
    at Object.emit (events.js:305:20)
(node:24456) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 3)
(node:24456) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I'll see if I can install the dependency by itself into your template project and see if I get the same error, and post the results here.

@antony
Copy link
Author

antony commented Feb 28, 2020

One extra note, this is a rare css import I'm using directly in _layout.svelte. It looks like this:

  import '@beyonk/gdpr-cookie-consent-banner/dist/style.css'

Will try to import it another way and see if it makes a difference.

@antony
Copy link
Author

antony commented Feb 28, 2020

Ok. I don't get this error any more when I move it to my global SCSS.

So there's possibly a problem in that the plugin doesn't support importing CSS.

@rixo
Copy link
Owner

rixo commented Apr 8, 2020

It's very possible I've overlooked some things with CSS... Didn't dig it much yet.

But I've just checked your project's Rollup config and I see nothing in there that would allow importing CSS directly into JS.

Is there something I missed? Does this import work with the official plugin?

@antony
Copy link
Author

antony commented Apr 8, 2020

@rixo It's a good question - I'll create a repro for you since I'm not entirely sure I remember how this works.

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