-
Notifications
You must be signed in to change notification settings - Fork 147
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-preprocess default option problems #362
Comments
Got the same problem. I'm using SvelteKit and everytime defaults: {} has been set, I get
unexpected text ";
|
Hey, @danitatt 👋 We're discouraging the usage of the |
It turns out this also causes issues with Vite's
Vite only looks at the I would really like to be able to set the Putting it in |
That we can do. Let's wait for @dummdidumm and decide the best move forward. |
@benmccann I am trying to understand the issue here, so have a few questions. Is the issue here that vite is unable to distinguish what language is being used without an explicit I am asking about the latter because I am getting the issue you described in your comment with no changes to my defaults and having the |
Yes, for the Vite issue you need to specify |
I'm in favor of logging a deprecation notice in the next minor and removing the functionality in the next major. While it feels nice to not have to write it every time, it introduces too many inconsistencies and maintenance burden all over the place, which hurts users of the default option more than it helps. The prettier/eslint plugin need to know it, language tools need to know it, now apparently vite needs to know it, too. |
Yes, please do this soon! Would have saved me a lot of time trying to discern why builds on Vercel suddenly started failing but not on my local when I upgraded kit from v135 to v157. I couldn't find anything on this note anywhere until incrementally upgrading kit to v146 and reading the PR for it - sveltejs/kit#2137. |
There we go #393 |
Deprecation notice released in 4.8.0 🎉 |
The examples are all using rollup. Any idea how the below config can be modified to work with snowpack?. If we remove the defaults and just use
|
That sounds like a bug that needs to be filed with snowpack |
Possibly. However, is there an alternate option for typescript that can be added instead of defaults, which can make the deprecation notice go away? |
No, the whole point of the deprecation message is to nudge you into not using it anymore, and there is no replacement, you should do |
Using
does not work but using
Works. |
We do have script lang="ts" in all the files. However, if we remove the
defaults section in svelte.config.js, snowpack compilation fails. If we
keep the defaults, svelte-preprocess throws the deprecation warning.
…On Mon, Sep 20, 2021 at 6:57 PM Salman ***@***.***> wrote:
Using
<script lang="typescript">
does not work but using
<script lang="ts">
Works.
I think both ts and typescript should work
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#362 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAH3GJ4466DW5C7GNEIRYYDUC4ZC3ANCNFSM45JAFBDQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
@girishnuli, would you be able to add a line to // probably near line 175 at @snowpack/plugin-svelte==3.7.0
console.log("---", filePath); // <-- add this to check which file has a problem on this
const compiled = svelte.compile(codeToCompile, finalCompileOptions);
const {js, css} = compiled; (for myself, I realized one file where |
@outloudvi Turns out there was just one file that was missing lang="ts" and causing the build to fail. Your solution helped identify the file and fix the issue. Thanks a ton for the help. |
* Move away from making scss the default, instead specify it manually ("defaults" are now discouraged: sveltejs/svelte-preprocess#362) * Import only the parts of protocol we actually need for each component, this speeds up the build by a fair chunk (50.25 -> 18.85 seconds on my MacBook) and helps pave the way to #682.
* Move away from making scss the default, instead specify it manually ("defaults" are now discouraged: sveltejs/svelte-preprocess#362) * Import only the parts of protocol we actually need for each component, this speeds up the build by a fair chunk (50.25 -> 18.85 seconds on my MacBook) and helps pave the way to #682.
* Move away from making scss the default, instead specify it manually ("defaults" are now discouraged: sveltejs/svelte-preprocess#362) * Import only the parts of protocol we actually need for each component, this speeds up the build by a fair chunk (50.25 -> 18.85 seconds on my MacBook) and helps pave the way to #682.
what the ... default is depcreated ... what we have to do now |
Add |
Hello everyone👋🏼 I really love svelte + svelte-preprocess for the ability to use the defaults option.
But, when I use npm packages (e.g swiper/svelte), I get the error because the npm module is written in html/css/ js by default.
I get this same error when I use svelte-kit. Svelte-kit file generated without defaults and throws an error:
.svelte-kit/dev/generated/root.svelte
How can this problem be avoided? Maybe add option excludePaths? Where path node_modules & .svelte-kit exclude by default?
The text was updated successfully, but these errors were encountered: