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

Typescript support: Package path ./wrap is not exported from package svelte-spa-router #317

Open
jmarkyston opened this issue Jan 30, 2024 · 3 comments

Comments

@jmarkyston
Copy link

I really love the quality of life this package brings.

I'm trying to use this in a typescript setting, so rather than a routes.js file, I've added a routes.ts file, which looks like this:

import Login from './views/login.svelte';
import Dashboard from './views/dashboard.svelte';
import {wrap} from 'svelte-spa-router/wrap'

export const routes = {
  '/': Login,
  '/dashboard': wrap({})
}

When I import and attempt to use wrap(), I get the Package path ./wrap is not exported from package svelte-spa-router error.

My tsconfig has allowJs and allowSyntheticDefaultImports turned on, but this error still exists. I've also tried importing it like `import * as wrap from 'svelte-spa-router/wrap', but I get the same error.

I see a ts type definition for the wrap file. Do you know why this isn't working for me?

@ItalyPaleAle
Copy link
Owner

Can you confirm you're setting "type": "module" in your package.json?

@jmarkyston
Copy link
Author

It wasn't set, but it is now. I updated my webpack config to support that. Sadly, I'm getting the same error. I tried removing node_modules and package.lock and running npm i again just in case, but that didn't help.

@Pareek499
Copy link

Hi,
Were you able to resolve this issue?
I am facing similar issue when using JavaScript

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

3 participants