You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Solid leaves type imports behind, causing some systems to try to import non-existing things at runtime.
This relates to the node vs web structure. The app in question imports lume, which imports solid-js/html, etc, however does not use these APIs on the backend, only on the client.
The workaround for the app is to use await import('lume') in client-side code, so it is ignored in SvelteKit pre-rendering.
Here's a sample error:
file:///Users/trusktr/src/project/node_modules/.pnpm/[email protected]/node_modules/solid-js/html/dist/html.js:1
import { effect, style, insert, spread, createComponent, delegateEvents, classList, mergeProps, dynamicProperty, setAttribute, setAttributeNS, addEventListener, Aliases, PropAliases, Properties, ChildProperties, DelegatedEvents, SVGElements, SVGNamespace } from 'solid-js/web';
^^^^^^^
SyntaxError: The requested module 'solid-js/web' does not provide an export named 'Aliases'
at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:190:5)
SyntaxError: The requested module 'solid-js/web' does not provide an export named 'Aliases'
file:///Users/trusktr/src/project/node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@sveltejs/kit/src/core/prerender/prerender.js:50
throw new Error(format_error(details, config));
^
Error: 500 /
at file:///Users/trusktr/src/project/node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@sveltejs/kit/src/core/prerender/prerender.js:50:11
at save (file:///Users/trusktr/src/project/node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@sveltejs/kit/src/core/prerender/prerender.js:339:4)
at visit (file:///Users/trusktr/src/project/node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@sveltejs/kit/src/core/prerender/prerender.js:226:3)
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
trusktr
changed the title
(WIP) add importsNotUsedAsValues:error to tsconfig
(WIP) add importsNotUsedAsValues:error to tsconfig, fix resulting code errors
Jan 26, 2023
Should the new 2.0 breaking apart nested imports fix this naturally? (ie.. @solidjs/web instead of solid-js/web)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Solid leaves type imports behind, causing some systems to try to import non-existing things at runtime.
This relates to the node vs web structure. The app in question
importslume, whichimportssolid-js/html, etc, however does not use these APIs on the backend, only on the client.The workaround for the app is to use
await import('lume')in client-side code, so it is ignored in SvelteKit pre-rendering.Here's a sample error:
How did you test this change?
Not done yet, need to test and update code