rsdavis / svelte-drawer

A Svelte component of a drawer that slides in from the side of the screen
20 stars 2 forks source link

error: No matching export in "browser-external:path" for import "join" #6

Open sp-cmingay opened 2 years ago

sp-cmingay commented 2 years ago

OK this is the strangest thing and I am 99.9% certain it's nothing to do with your component itself, however I can't figure out what the trigger might be because this was working for me an hour ago in the same project... Have you seen similar at all?

I've got a sveltekit project, I added your component with npm install svelte-drawer-component and got it working no problem at all. However now when I run npm run dev I see the following:

 > node_modules/totalist/sync/index.mjs:1:9: error: No matching export in "browser-external:path" for import "join"
    1 │ import { join, resolve } from 'path';
      ╵          ~~~~

 > node_modules/totalist/sync/index.mjs:1:15: error: No matching export in "browser-external:path" for import "resolve"
    1 │ import { join, resolve } from 'path';
      ╵                ~~~~~~~

 > node_modules/totalist/sync/index.mjs:2:9: error: No matching export in "browser-external:fs" for import "readdirSync"
    2 │ import { readdirSync, statSync } from 'fs';
      ╵          ~~~~~~~~~~~

 > node_modules/totalist/sync/index.mjs:2:22: error: No matching export in "browser-external:fs" for import "statSync"
    2 │ import { readdirSync, statSync } from 'fs';
      ╵                       ~~~~~~~~

 > node_modules/sirv/build.mjs:2:9: error: No matching export in "browser-external:path" for import "join"
    2 │ import { join, normalize, resolve } from 'path';
      ╵          ~~~~

 > node_modules/sirv/build.mjs:2:15: error: No matching export in "browser-external:path" for import "normalize"
    2 │ import { join, normalize, resolve } from 'path';
      ╵                ~~~~~~~~~

 > node_modules/sirv/build.mjs:2:26: error: No matching export in "browser-external:path" for import "resolve"
    2 │ import { join, normalize, resolve } from 'path';
      ╵                           ~~~~~~~

 > node_modules/local-access/index.mjs:1:9: error: No matching export in "browser-external:url" for import "format"
    1 │ import { format } from 'url';
      ╵          ~~~~~~

 > node_modules/local-access/index.mjs:2:9: error: No matching export in "browser-external:os" for import "networkInterfaces"
    2 │ import { networkInterfaces } from 'os';
      ╵          ~~~~~~~~~~~~~~~~~

Node wise I've absolutely no idea what's changed. I've not updated anything.

If I run npm uninstall svelte-drawer-component and run npm run dev again all is well.

Thanks!

sp-cmingay commented 2 years ago

For what it's worth, if I remove the package reference to svelte-drawer-component and manually add Drawer.svelte to my project it works as expected. I'm very confused!