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

Getting Vite error on when importing compile #255

Open
Tracked by #590
benaltair opened this issue May 18, 2021 · 7 comments
Open
Tracked by #590

Getting Vite error on when importing compile #255

benaltair opened this issue May 18, 2021 · 7 comments
Labels
assigned Whether or not this bug has been assigned some to some other issues as a subtask or pre-req bug Something isn't working 🕵️ I'm looking into it environment An issue with the environment

Comments

@benaltair
Copy link

When including import { compile } from 'mdsvex'; in a route I immediately get the following error:

SyntaxError: The requested module '/@id/__vite-browser-external:path' does not provide an export named 'join'

This happens without using compile anywhere and it immediately fixed when removing the import.

Running Svelte Kit 1.0.0-next.103 with standard (for Kit so far) config.

@pngwn
Copy link
Owner

pngwn commented May 18, 2021

It is probably using the normal esm module which expects a node environment currently. There is a browser module, I don't know if there is a way to tell vite which to use. I am yet to add the new entrypoints to mdsvex but it does have a browser field.

@pixelscript
Copy link

I got around this by using:
import * as mdsvex from 'mdsvex/dist/browser-umd';

@pngwn
Copy link
Owner

pngwn commented Sep 10, 2021

Using proper ESM export paths might fix this.

@pngwn pngwn added 🕵️ I'm looking into it bug Something isn't working mdsvex labels Sep 10, 2021
@pngwn pngwn added this to mdsvex Oct 16, 2021
@pngwn pngwn moved this to Refine in mdsvex Oct 16, 2021
@techydad05
Copy link

When including import { compile } from 'mdsvex'; in a route I immediately get the following error:

SyntaxError: The requested module '/@id/__vite-browser-external:path' does not provide an export named 'join'

This happens without using compile anywhere and it immediately fixed when removing the import.

Running Svelte Kit 1.0.0-next.103 with standard (for Kit so far) config.

did you ever figure this out?

@benaltair
Copy link
Author

benaltair commented Mar 4, 2022

did you ever figure this out?

@techydad05 Unfortunately not, I just went with a different solution entirely.

@git-no
Copy link

git-no commented Mar 30, 2022

Same issue here. Error import path__default, { join } from 'path';.
Svelte v 3.46.4.
I need compile because there are no markdown files in my repo, I fetch markdown via api
Unfortunately MDSeveX is a show stopper on my repo. Hope it gets solved soon :-)

@tim-ming
Copy link

tim-ming commented Dec 4, 2022

Following https://gist.github.com/FbN/0e651105937c8000f10fefdf9ec9af3d vite build runs without problems.

@pngwn pngwn added environment An issue with the environment assigned Whether or not this bug has been assigned some to some other issues as a subtask or pre-req and removed mdsvex labels Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assigned Whether or not this bug has been assigned some to some other issues as a subtask or pre-req bug Something isn't working 🕵️ I'm looking into it environment An issue with the environment
Projects
No open projects
Status: Refine
Development

No branches or pull requests

6 participants