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

Svelte-tablesort fails to build with current svelte and vite #7

Open
bjmckenz opened this issue Jun 13, 2022 · 0 comments
Open

Svelte-tablesort fails to build with current svelte and vite #7

bjmckenz opened this issue Jun 13, 2022 · 0 comments

Comments

@bjmckenz
Copy link

Description

Can't get svelte-tablesort to build cleanly. I can get it to build for "production" by hacking a few package.json files. But vite (npm run dev) never works -- usually with "exports not defined" and "Sourcemap refers to missing files" (approx). Since I need to push to Heroku, vite is required.

Feel free to access this example via https:/bjmckenz/vite-svelte-prob

Apologies for no better ideas...Thanks.

Versions

[email protected] C:\Users\bjmckenz\Desktop\SOURCE\vite-svelte-prob
+-- @sveltejs/[email protected]
| +-- @sveltejs/[email protected]
| | +-- [email protected]
| | | -- [email protected] deduped | | -- [email protected] deduped
| -- [email protected] deduped +-- [email protected] | -- [email protected] deduped
+-- [email protected]
| +-- [email protected]
| | -- [email protected] deduped | -- [email protected] deduped
+-- [email protected]
| -- [email protected] | -- [email protected] deduped
`-- [email protected]

Steps

  • npm init svelte foo
  • cd foo
  • npm install
  • npm install svelte-tablesort
  • Copy example html from svelte-tablesort readme
  • (Either) npm run build
  • (or) npm run dev

Results

  • First, build fails with "TableSort not exported". Once that is hacked by adding "TableSort": "./TableSort.svelte" in the package.json, then vite complains that rollup failed to resolve it:

[vite]: Rollup failed to resolve import "svelte-tablesort" from "src/routes/index.svelte".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
build.rollupOptions.external

[vite]: Rollup failed to resolve import "svelte-tablesort" from "src/routes/index.svelte".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
build.rollupOptions.external
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
build.rollupOptions.external
at onRollupWarning (C:\Users\bjmckenz\Desktop\SOURCE\vite-svelte-prob\node_modules\vite\dist\node\chunks\dep- 8f5c9290.js:41772:19)
at onwarn (C:\Users\bjmckenz\Desktop\SOURCE\vite-svelte-prob\node_modules\vite\dist\node\chunks\dep-8f5c9290.js:41588:13)
at Object.onwarn (C:\Users\bjmckenz\Desktop\SOURCE\vite-svelte-prob\node_modules\rollup\dist\shared\rollup.js:23224:13)
at ModuleLoader.handleResolveId (C:\Users\bjmckenz\Desktop\SOURCE\vite-svelte- prob\node_modules\rollup\dist\shared\rollup.js:22508:26)
at C:\Users\bjmckenz\Desktop\SOURCE\vite-svelte-prob\node_modules\rollup\dist\shared\rollup.js:22469:26

package.json

"devDependencies": {
	"@sveltejs/adapter-auto": "next",
	"@sveltejs/kit": "next",
	"eslint": "^8.16.0",
	"eslint-plugin-svelte3": "^4.0.0",
	"svelte": "^3.44.0",
	"svelte-check": "^2.7.1",
	"typescript": "^4.7.2"
},
"type": "module",
"dependencies": {
	"svelte-tablesort": "^2.0.2"
}

}

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

1 participant