question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Svelte app breaks

See original GitHub issue

Describe the bug I installed version ^0.28.0 and my Svelte 3 breaks.

[!] (plugin commonjs) SyntaxError: Unexpected token (13:46) in ./node_modules/lodash/_nodeUtil.js
node_modules/lodash/_nodeUtil.js (13:46)
11:
12: /** Detect free variable `process` from Node.js. */
13: var freeProcess = moduleExports && freeGlobal.process;
                                                  ^
14:
15: /** Used to access faster Node.js helpers. */

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
jquensecommented, Jul 27, 2020

IDK i don’t use svelte, but doesn’t seem related to yup at all. Happy to help if there is something more specifically actionable for me here

0reactions
petrpercommented, Nov 6, 2021

The problem could be related to @rollup/plugin-replace plugin. Specify the full path replacement.

replace({
   preventAssignment: true,
   process: JSON.stringify({
      env: {
         isProd: production,
         ...config().parsed,
      },
   }),
}),

should be replaced with something like

replace({ preventAssignment: true, values: { "process.env.KEY": "VALUE" } }),

My simple solution.

function getReplacement() {
   const configKeys = Object.keys(config().parsed);
   let replacement = {};

   for (const key of configKeys) {
      replacement[`process.env.${key}`] = production ? process.env[key] : JSON.stringify(config().parsed[key]);
   }

   return replacement;
}

replace({
   preventAssignment: true,
   values: getReplacement(),
}),

hope it helps.

Read more comments on GitHub >

github_iconTop Results From Across the Web

store bind breaks conditional slot reactivity • REPL • Svelte
Resize the window width. The default and bork slots should switch places. 8. </p>. 9. ​. 10. <Foo>. 11. removing this store binding...
Read more >
SveltKit app on Netlify breaks after inactivity - Stack Overflow
I'm facing an issue with my SvelteKit app deployed on Netlify that if I load the app and then leave the page inactive...
Read more >
Componentizing our Svelte app - Learn web development
In the last article we started developing our to-do list app. The central objective of this article is to look at how to...
Read more >
Migrating Breaking Changes in SvelteKit - Netlify
SvelteKit has gone through a few breaking changes recently ... breaking changes and navigate you through migrating an app to get it up...
Read more >
SvelteKit Breaking Changes 2022 - My Reactions and What ...
Migrating Breaking Changes in SvelteKit just announced some major breaking changes. Here's what you need to know! Migrating Breaking Changes ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found