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

Following usage example leads to an error. #83

Open
FabianCarrasco opened this issue Nov 20, 2024 · 3 comments
Open

Following usage example leads to an error. #83

FabianCarrasco opened this issue Nov 20, 2024 · 3 comments
Labels
question Further information is requested

Comments

@FabianCarrasco
Copy link

Issue

There seems to be an issue with the export from the package since I get this error when trying to run the example provided.

import svelte from "highlight.svelte";
       ^^^^^^
SyntaxError: The requested module 'highlight.svelte' does not provide an export named '
default'

    at ModuleJob._instantiate (node:internal/modules/esm/module_job:177:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:260:5)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:543:26)
    at async loadConfigFromBundledFile (file:///Users/fabiancarrasco/Documents/npm/Test
Svelte/node_modules/vite/dist/node/chunks/dep-CB_7IfJ-.js:66691:15)
    at async loadConfigFromFile (file:///Users/fabiancarrasco/Documents/npm/TestSvelte/
node_modules/vite/dist/node/chunks/dep-CB_7IfJ-.js:66532:24)
    at async resolveConfig (file:///Users/fabiancarrasco/Documents/npm/TestSvelte/node_
modules/vite/dist/node/chunks/dep-CB_7IfJ-.js:66140:24)
    at async _createServer (file:///Users/fabiancarrasco/Documents/npm/TestSvelte/node_
modules/vite/dist/node/chunks/dep-CB_7IfJ-.js:62758:18)
    at async CAC.<anonymous> (file:///Users/fabiancarrasco/Documents/npm/TestSvelte/nod
e_modules/vite/dist/node/cli.js:735:20)```
@moonlitgrace
Copy link
Owner

hi @FabianCarrasco, seems like you forgot to build the package first, it can be done with npm run build.
you can easily build and run svelte example app with npm run dev from root level. this will build the package then spin up svelte dev server.

let me know if you see any other issues,
cheers!

@FabianCarrasco
Copy link
Author

Hi @moonlitgrace, I tried building the project but it seems that it does not work still. It could be that I am trying to use it on a npm package.

@moonlitgrace
Copy link
Owner

Hi @moonlitgrace, I tried building the project but it seems that it does not work still. It could be that I am trying to use it on a npm package.

oh that's weird. weren't you trying to run this example: https://github.com/moonlitgrace/highlight.svelte/tree/main/apps/example-svelte? can you check the node_modules to verify if its properly installed or not? or any reproducible example you can provide?

@moonlitgrace moonlitgrace added the question Further information is requested label Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants