Skip to content

fix: can't import transform in vite project without type: module #11

@HassanZahirnia

Description

@HassanZahirnia

🐛 The bug

When I try to use magic-regexp in a Laravel + Vite project I get the following errors:

Error [ERR_REQUIRE_ESM]: require() of ES Module /home/hassan/project/node_modules/.pnpm/magic-regexp@0.2.1_vite@3.0.1/node_modules/magic-regexp/dist/transform.mjs not supported. 

🛠️ To reproduce

You can easily reproduce by following these steps:

laraven new npx @preset/cli apply laravel:inertia php artisan serve npm run dev 

When you add the vite plugin, you will see the dev command will fail with error.

🌈 Expected behaviour

I expect it to work based on the project readme instructions and code examples.

ℹ️ Additional context

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions