-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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-kit sync #4165
Comments
Small note: I think it is generally preferable to use NPM |
My bad: I see "prepare": "svelte-kit sync" is used instead of "postinstall" in my package-json. But my error still remains. Is my error related to this issue? I installed the skeleton version of kit. I have a svelte.config.js, adapted for node as usual (I've gotten this deployment to work for at least six other domains, the last one a little over a week ago). The only thing that immediately jumps out at me is that my package.json didn't have this:
(But even if I manually add that package, I get the same error.)
Removing "prepare": "svelte-kit sync" from package.json (and issuing the run build command locally, etc.) solved my problem. |
A side effect of this change is that you used to be able to run something like this in a Dockerfile:
And it would work. Now, with this prepare script in place, you get this:
If I remove the prepare script it works again. 😢 If I add the svelte.config.js to the COPY line it gets further but still errors:
Which seems to suggest that it now expects the entire app to be present to install dependencies which is not typically the case in many Dockerfiles which tend to build dependencies first and then copy source code into the container. |
That's a good catch @rmontgomery429 - I've opened #4366. |
Describe the problem
In #4120, we introduce generated types, which give you type safety when using
params
inside pages and endpoints. (In future, we want to extend that to props as well.)One minor wrinkle is that the types aren't generated until you run
svelte-kit dev
orsvelte-kit build
, which means that if you were to (for example) typecheck in CI before building the app, it would fail.Describe the proposed solution
It would be good to collate all the work that takes the filesystem as input (i.e. generating
manifest.js
,Root.svelte
and now the route-level types) into a new function — let's call itsync
— and expose it via the CLI assvelte-kit sync
. (Open to alternative names but this one seems good enough to me.)We could then add this to the default template as a postinstall script:
Importance
would make my life easier
The text was updated successfully, but these errors were encountered: