We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
https://github.com/rishabh3112/next-15-swc-external-helpers-bug
npm install
npm run dev
It should work as it was working in next 14.
__webpack_require__.r(__webpack_exports__); /* harmony import */ var _swc_helpers_type_of__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @swc/helpers/_/_type_of */ "./node_modules/@swc/helpers/esm/_type_of.js"); (function(root, factory) { if (typeof define === "function" && __webpack_require__.amdO) { define([ "exports" ], function(exports1) { root.Backbone = factory(root, exports1); }); } else if (typeof exports !== "undefined") { factory(root, exports); } else { root.Backbone = factory(root, {}); } })(window, function(root, Backbone) { // Removed actual backbone code for minimal reproduction Backbone.Modal = function() { var something = root.something; // So that _type_of swc helper import gets added to the code if ((typeof something === "undefined" ? "undefined" : (0,_swc_helpers_type_of__WEBPACK_IMPORTED_MODULE_0__._)(something)) === "object") { return "object"; } return "don't know"; }; return Backbone; });
SWC playground link: link
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function(root, factory) { if (true) { !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ exports ], __WEBPACK_AMD_DEFINE_RESULT__ = (function(exports1) { root.Backbone = factory(root, exports1); }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else {} })(window, function(root, Backbone) { // Removed actual backbone code for minimal reproduction Backbone.Modal = function() { var something = root.something; // So that _type_of swc helper import gets added to the code if (typeof something === "object") { return "object"; } return "don't know"; }; return Backbone; });
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 21.6.0: Wed Apr 24 06:05:14 PDT 2024; root:xnu-8020.240.18.708.4~1/RELEASE_ARM64_T6000 Available memory (MB): 65536 Available CPU cores: 10 Binaries: Node: 18.18.2 npm: 9.8.1 Yarn: 1.22.22 pnpm: 9.12.2 Relevant Packages: next: 15.0.3 // Latest available version is detected (15.0.3). eslint-config-next: N/A react: 18.3.1 react-dom: 18.3.1 typescript: N/A Next.js Config: output: N/A
SWC, Webpack
next dev (local), next build (local), next start (local), Other (Deployed)
It should work like it was working in next 14. Willing to contribute.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Link to the code that reproduces this issue
https://github.com/rishabh3112/next-15-swc-external-helpers-bug
To Reproduce
npm install
npm run dev
Current vs. Expected behavior
It should work as it was working in next 14.
Current: After webpack parsing with external helper (Next 15):
SWC playground link: link
Expected: After webpack parsing without external helper (Next 14):
SWC playground link: link
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 21.6.0: Wed Apr 24 06:05:14 PDT 2024; root:xnu-8020.240.18.708.4~1/RELEASE_ARM64_T6000 Available memory (MB): 65536 Available CPU cores: 10 Binaries: Node: 18.18.2 npm: 9.8.1 Yarn: 1.22.22 pnpm: 9.12.2 Relevant Packages: next: 15.0.3 // Latest available version is detected (15.0.3). eslint-config-next: N/A react: 18.3.1 react-dom: 18.3.1 typescript: N/A Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
SWC, Webpack
Which stage(s) are affected? (Select all that apply)
next dev (local), next build (local), next start (local), Other (Deployed)
Additional context
It should work like it was working in next 14.
Willing to contribute.
The text was updated successfully, but these errors were encountered: