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
[WIP] Fix HMR failure with js error on load #898
Conversation
Tests fail because errors from try {
// We expect browser-resolve to replace fs with an empty module, so readFileSync will be undefined
return require('fs').readFileSync(__dirname + '/package.json')
}
catch(_) {
return 'test-pkg-ignore-fs-ok'
} Would it be better to instead change require = function (...){...};
require({1:[], .....}); (Maybe this doesn't work at all because of how |
loocking forward to this |
@mischnic localRequire needs the same fix, since it bares the same problem |
@devongovett Could you take a look at how to fix this correctly? |
Now that this works correctly in the dev server as of parcel-bundler#974, this should be a much more sensible default for both production and development builds. Fixes parcel-bundler#714.
📨 waiting for the fix also |
38abaeb
to
cacbc78
Compare
…parcel-bundler#2046) --- name: Add test to fs.readFileSync in TypeScript files --- ``` parcel-bundler version 1.9.7 ``` ## 💥 Problem Inlining file in browser mode doesn't work in TypeScript files when `fs` is imported with star import or default import. The only way to use `readFileSync` is: ```typescript import { readFileSync } from 'fs'; const raw = readFileSync(__dirname + '/raw.tsx', 'utf-8'); ``` ### Reproduction: Repo: https://github.com/hasparus/parcel-readfilesync-typescript-repro ghPages: https://hasparus.github.io/parcel-readfilesync-typescript-repro/ CodeSandbox: https://codesandbox.io/s/github/hasparus/parcel-readfilesync-typescript-repro/tree/master/ Fun Fact: All ways to import `fs` work on CodeSandbox (parcel template). ## ↪️ Pull Request Adds test to `fs.readFileSync` in TypeScript files and thus provides better workaround for parcel-bundler#1736. ## ✔️ PR Todo - [X] Link in parcel-bundler#1736. - [X] Post reproduction to CodeSandbox. - [ ] Document how to use `readFileSync` in TypeScript?
Was running `parcel build` and the auto installer started running, I went to disable it and found that the option was not available here
…dler#2089) # ↪️ Pull Request Do not load existing sourcemaps if sourcemaps are disabled
--- name: 🙋 Fix HMR for Pug assets --- <!--- Thanks for filing a pull request 😄 ! Before you submit, please read the following: Search open/closed issues before submitting since someone might have pushed the same thing before! --> ## ↪️ Pull Request <!--- Provide a general summary of the pull request here Does this address an existing issue? --> parcel-bundler#2090 ## 💻 Examples <!-- Examples help us understand the requested feature better --> ## ✔️ PR Todo - [ ] Added/updated unit tests for this change - [ ] Filled out test instructions - [x] Included links to related issues/PRs <!-- Love parcel? Please consider supporting our collective: 👉 https://opencollective.com/parcel/donate -->
cacbc78
to
2071a3c
Compare
Due to move to monorepo which rewrote the git history, this PR was automatically closed. Please open a new PR against master with your changes. You can do a diff against the |
global.require
isn't defined if a childBundle called by newRequire throws an error.This causes an error on HMR update.
More details in #879 (comment)
fixes #879