Skip to content
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

TypeError: swc.vite is not a function #26

Closed
shlroland opened this issue Apr 14, 2022 · 4 comments
Closed

TypeError: swc.vite is not a function #26

shlroland opened this issue Apr 14, 2022 · 4 comments

Comments

@shlroland
Copy link

error when starting dev server:
TypeError: swc.vite is not a function
at file:///Users/shenhaoliang/Desktop/jgy/workbench/vite.config.ts.js?t=1649945077486:62:9
at ModuleJob.run (node:internal/modules/esm/module_job:195:25)
at async Promise.all (index 0)
at async ESMLoader.import (node:internal/modules/esm/loader:337:24)
at async importModuleDynamicallyWrapper (node:internal/vm/module:437:15)
at async loadConfigFromFile (/Users/shenhaoliang/Desktop/jgy/workbench/node_modules/vite/dist/node/chunks/dep-611778e0.js:61416:31)
at async resolveConfig (/Users/shenhaoliang/Desktop/jgy/workbench/node_modules/vite/dist/node/chunks/dep-611778e0.js:60962:28)
at async createServer (/Users/shenhaoliang/Desktop/jgy/workbench/node_modules/vite/dist/node/chunks/dep-611778e0.js:58813:20)
at async CAC. (/Users/shenhaoliang/Desktop/jgy/workbench/node_modules/vite/dist/node/cli.js:688:24)

version: unplugin-swc 1.3.0

@egoist
Copy link
Collaborator

egoist commented Apr 14, 2022

please provide a repro

@shlroland
Copy link
Author

please provide a repro

That's because I set "type": "module" in package.json, so this plugin doesn;t support native esm?

@egoist egoist self-assigned this Apr 17, 2022
@egoist egoist closed this as completed in 8688cf3 Apr 17, 2022
@github-actions
Copy link

🎉 This issue has been resolved in version 1.3.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@bestickley
Copy link

@shlroland, did the update in 1.3.2 work for you in an ESM package? While I can now import the function, I'm getting an error about dynamic use of require. See here: Error: Dynamic require of "path" is not supported

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

No branches or pull requests

3 participants