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

fix: self exported module call stack error #1221

Merged
merged 2 commits into from
May 1, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
remove warning
  • Loading branch information
pikax committed May 1, 2022
commit 5bfa7b829af698a78b27491c77ba68a3f26a33f2
6 changes: 2 additions & 4 deletions packages/vite-node/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,11 +255,9 @@ function proxyMethod(name: 'get' | 'set' | 'has' | 'deleteProperty', tryDefault:
function exportAll(exports: any, sourceModule: any) {
// #1120 when a module exports itself it causes
// call stack error
if (exports === sourceModule) {
// eslint-disable-next-line no-console
console.warn('[vite-node] module is being self exported', sourceModule)
if (exports === sourceModule)
return
}

// eslint-disable-next-line no-restricted-syntax
for (const key in sourceModule) {
if (key !== 'default') {
Expand Down