Open some1awesome opened 1 year ago
I am also experiencing the same issue
I also have the same issue. It works with "17.1.0-beta.4" but not with "17.1.1".
Same with 17.1.3
Having the same problem with a vscode extension built with
"targets": { "build": { "executor": "@nx/webpack:webpack", "options": { "outputPath": "dist/apps/wkc-web-vs-code-extension", "main": "apps/wkc-web-vs-code-extension/src/main.ts", "tsConfig": "apps/wkc-web-vs-code-extension/tsconfig.app.json", "assets": [ "apps/wkc-web-vs-code-extension/src/assets", "apps/wkc-web-vs-code-extension/src/package.json", "apps/wkc-web-vs-code-extension/src/LICENSE.txt" ], "target": "node", "compiler": "tsc" }, "configurations": { "production": { "optimization": true, "extractLicenses": true, "inspect": false, "fileReplacements": [ { "replace": "apps/wkc-web-vs-code-extension/src/environments/environment.ts", "with": "apps/wkc-web-vs-code-extension/src/environments/environment.prod.ts" } ] } }, "outputs": ["{options.outputPath}"] }, }
By reverting some update I can see that it started after updating to 17.1.1 from 17.0.3
We were able to resolve this issue by adding the following to our webpack.config.ts:
output: { libraryTarget: 'commonjs2', },
This issue has been automatically marked as stale because it hasn't had any activity for 6 months. Many things may have changed within this time. The issue may have already been fixed or it may not be relevant anymore. If at this point, this is still an issue, please respond with updated information. It will be closed in 21 days if no further activity occurs. Thanks for being a part of the Nx community! 🙏
Current Behavior
After upgrading to nx 17.1.2 we can no longer deploy our project to AWS lambda or google firebase functions.
When uploading to firebase functions the firebase cli can't seem to find the firebase functions we are trying to upload.
When uploading to AWS the library is uploaded properly but when we try to hit the endpoint through api gateway we get an error saying it cannot find main.handler.
Expected Behavior
Projects should be able to be uploaded to firebase function and AWS lambda and still work properly once uploaded.
GitHub Repo
https://github.com/some1awesome/nestjs-upgrade-serverless-issue
Steps to Reproduce
Nx Report
Failure Logs
Package Manager Version
No response
Operating System
Additional Information
We have isolated the problem to be due to the latest upgrade of @nx/webpack, if we run
nx migrate @nx/webpack --to="@nx/webpack@16.10.0"
it begins to work properly again.It seems to be due to the absence of the following lines of code:
var __webpack_export_target__ = exports; for(var i in __webpack_exports__) __webpack_export_target__[i] = __webpack_exports__[i]; if(__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, "__esModule", { value: true }); /******/ })()
If after running the build those lines are added in then we can upload and run the server properly, but the original build does not include those lines.
If you want to fully test it you will need a blaze plan firebase account. Then you can change the firebase.json to point at that account and try uploading the testApi. To do so run the following:
1) npm run build:functions 2) firebase deploy --only functions:testApi