Skip to content

Could not dynamically import error #666

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

Open
yyz945947732 opened this issue Apr 12, 2025 · 0 comments
Open

Could not dynamically import error #666

yyz945947732 opened this issue Apr 12, 2025 · 0 comments

Comments

@yyz945947732
Copy link

Describe the bug

import { preprocess } from 'svelte/compiler';
import { sveltePreprocess } from 'svelte-preprocess';

const preprocessed = await preprocess(source, sveltePreprocess());
const ast = svelte.compile(preprocessed.code);

Is it allowed to write code like this? Will it throw an error if I do.

Image

Logs

Error: Could not dynamically require "./transformers/typescript". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.

To Reproduce

above

Expected behavior

no error

Stacktraces

no

Information about your project:

  • Your browser and the version: no need

  • Your operating system: Windows

  • svelte-preprocess version 6.0.3

  • Whether your project uses : vite

Additional context
no

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant