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
Created a stackoverflow question regarding this issue here, with more code snippets.
Clean project, using the nx empty workspace (or with an angular one, its the same), added a svelte project using the command line nx g @nxext/svelte:app my-app, then added a component using nx g @nxext/svelte:c my-comp and after inserting this line in the MyComponent.svelte file:
letname: string;
the tests stop working, giving the following error:
FAIL my-app apps/my-app/src/components/my-comp/my-comp.spec.ts
● Test suite failed to run
ParseError: Unexpected token
at error (../../node_modules/svelte/src/compiler/utils/error.ts:25:16)
at Parser$1.error (../../node_modules/svelte/src/compiler/parse/index.ts:100:3)
at Parser$1.acorn_error (../../node_modules/svelte/src/compiler/parse/index.ts:93:8)
at Object.read_script [as read] (../../node_modules/svelte/src/compiler/parse/read/script.ts:51:10)
at tag (../../node_modules/svelte/src/compiler/parse/state/tag.ts:205:27)
at new Parser$1 (../../node_modules/svelte/src/compiler/parse/index.ts:52:12)
at parse (../../node_modules/svelte/src/compiler/parse/index.ts:216:17)
at Object.compile (../../node_modules/svelte/src/compiler/compile/index.ts:91:14)
at Object.process (../../node_modules/svelte-jester/src/transformer.js:21:25)
at ScriptTransformer.transformSource (../../node_modules/@jest/transform/build/ScriptTransformer.js:464:35)
if I insert instead just:
letname;
it works again.
Unfortunately the TypeScript usage is a dealbreaker for us.
The text was updated successfully, but these errors were encountered:
Hi,
thanks for your issue. I added some changes which will come with the next release and simplify this. For now for you to add for the tests:
For the jest.config.js change the svelte transformer to this (with a path in your application directory)
and add a svelte.config.js in the dir with the following.
const sveltePreprocess = require('svelte-preprocess');
module.exports = {
// Consult https://github.com/sveltejs/svelte-preprocess
// for more information about preprocessors
preprocess: sveltePreprocess()
};
I'll add the files and paths as a default in the next release and add a option for the build to read in the config file as well to simplify the custom configs
Created a stackoverflow question regarding this issue here, with more code snippets.
Clean project, using the nx empty workspace (or with an angular one, its the same), added a svelte project using the command line
nx g @nxext/svelte:app my-app
, then added a component usingnx g @nxext/svelte:c my-comp
and after inserting this line in the MyComponent.svelte file:the tests stop working, giving the following error:
if I insert instead just:
it works again.
Unfortunately the TypeScript usage is a dealbreaker for us.
The text was updated successfully, but these errors were encountered: