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(webpack): use path.resolve to create file path #512

Merged
merged 1 commit into from
Aug 3, 2021

Conversation

Feiyang1
Copy link
Contributor

This PR contains a:

  • bugfix
  • new feature
  • code refactor
  • test update
  • typo fix
  • metadata update

Motivation / Use-Case

I'm getting no such file or directory error from karma-webpack:

ERROR [karma-server]: Error: ENOENT: no such file or directory, open 13 07 2021 21:35:45.728:ERROR [karma-server]: Error: ENOENT: no such file or directory, open '/var/folders/fd/17654frj3379vn3wr07k_s_000jyn1/T/_karma_webpack_209189/../../../../../../Users/feiyangc/Projects/firebase-js-sdk/packages/logger/dist/src/logger.d.ts'
    at Object.openSync (fs.js:476:3)
    at Object.readFileSync (fs.js:377:35)
    at /Users/feiyangc/Projects/firebase-js-sdk/node_modules/karma-webpack/lib/webpack/plugin.js:24:66
    at Array.forEach (<anonymous>)
    at /Users/feiyangc/Projects/firebase-js-sdk/node_modules/karma-webpack/lib/webpack/plugin.js:17:29
    at Hook.eval [as callAsync] (eval at create (/Users/feiyangc/Projects/firebase-js-sdk/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:18:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/feiyangc/Projects/firebase-js-sdk/node_modules/tapable/lib/Hook.js:18:14)
    at /Users/feiyangc/Projects/firebase-js-sdk/node_modules/webpack/lib/Compiler.js:482:23
    at Compiler.emitRecords (/Users/feiyangc/Projects/firebase-js-sdk/node_modules/webpack/lib/Compiler.js:874:39)
    at /Users/feiyangc/Projects/firebase-js-sdk/node_modules/webpack/lib/Compiler.js:474:11 {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: '/var/folders/fd/17654frj3379vn3wr07k_s_000jyn1/T/_karma_webpack_209189/../../../../../../Users/feiyangc/Projects/firebase-js-sdk/packages/logger/dist/src/logger.d.ts'
}

I think the issue is that /var is a symlink to /private/var, and readFileSync incorrectly (or correctly?) resolve the path to /private/Users/feiyangc/Projects/firebase-js-sdk/packages/logger/dist/src/logger.d.ts while the correct path should be without /private.

Using path.resolve creates the correct file path.

Breaking Changes

Additional Info

@codymikol
Copy link
Owner

Thanks for the PR! I'll try and take a look at this tonight.

@Feiyang1
Copy link
Contributor Author

@codymikol any chance you have taken a look at it?

@codymikol
Copy link
Owner

Sorry, just closed on a house last week and life has been a bit crazy 😅

Copy link
Owner

@codymikol codymikol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 Thank you for your contribution!!

@codymikol codymikol merged commit f734b10 into codymikol:master Aug 3, 2021
@codymikol
Copy link
Owner

@ryanclark any chance you'd have a moment to help me put out a hotfix release for this?

@Feiyang1
Copy link
Contributor Author

@ryanclark any update on a new release?

@amad
Copy link

amad commented Oct 12, 2021

Any ETA for releasing this bugfix?

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

Successfully merging this pull request may close these issues.

3 participants