Skip to content

Could not dynamically import error #666

Open
@yyz945947732

Description

@yyz945947732

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions