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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web Extension Transformer: esmodule-helpers.js fails to load #7952

Closed
fregante opened this issue Apr 14, 2022 · 0 comments 路 Fixed by #7958
Closed

Web Extension Transformer: esmodule-helpers.js fails to load #7952

fregante opened this issue Apr 14, 2022 · 0 comments 路 Fixed by #7958

Comments

@fregante
Copy link
Contributor

fregante commented Apr 14, 2022

馃悰 bug report

My options page isn't being built correctly. Opening the options page in the browser results into this line failing:

var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js");

and the console error:

options.6f3d3386.js:63 Uncaught Error: Cannot find module '8ISrk'
    at newRequire (options.6f3d3386.js:61:19)
    at newRequire (options.6f3d3386.js:45:18)
    at localRequire (options.6f3d3386.js:84:35)
    at Object.3fApi.webextension-polyfill (options.6f3d3386.js:146:21)
    at newRequire (options.6f3d3386.js:71:24)
    at options.6f3d3386.js:122:5
    at options.6f3d3386.js:145:3

馃帥 Configuration (.babelrc, package.json, cli command)

{
	"extends": "@parcel/config-webextension"
}
	"browserslist": [
		"last 1 Chrome version",
		"last 1 Firefox version"
	],

馃捇 Code Sample

The content of options.js is just:

import browser from 'webextension-polyfill';

and part of the output is:

})({"3fApi":[function(require,module,exports) {
var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js");
var _webextensionPolyfill = require("webextension-polyfill");
var _webextensionPolyfillDefault = parcelHelpers.interopDefault(_webextensionPolyfill);

},{"webextension-polyfill":"kPFTQ","@parcel/transformer-js/src/esmodule-helpers.js":"8ISrk"}],"kPFTQ":[function(require,module,exports) {

Full example in https://github.com/fregante/browser-extension-template/pull/75/files

馃實 Your Environment

Software Version(s)
Parcel 2.0.0-nightly.1049
parcel/config-webextension 2.4.2-nightly.2674
Node v16.4.2
npm/Yarn 7.18.1
Operating System macOS 11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants