Reputation: 21
I'm trying to build an electron app using angular, TypeORM, SQLite and other component as webpack.
I started my development from an example I found at GitHub: https://github.com/CubikNeRubik/angular-electron-typeorm-starter.
After a while, I decided to update angular from 8.0 to 8.2. Then it was impossible to start my application. I've got an error "ReferenceError: path is not defined".
I restarted from beginning with the 8.0 version of angular. Without changing anything, the app start normally.
I upgraded the project using the "npm update" command.
Then I got this error:
[error] ReferenceError: path is not defined
at Object.getBrowserConfig (/Volumes/Data/ProjetNodes/TestUpdate/node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/browser.js:62:22)
at webpack_browser_config_1.generateBrowserWebpackConfigFromContext.wco (/Volumes/Data/ProjetNodes/TestUpdate/node_modules/@angular-devkit/build-angular/src/browser/index.js:55:27)
at scriptTargets.map.scriptTarget (/Volumes/Data/ProjetNodes/TestUpdate/node_modules/@angular-devkit/build-angular/src/utils/webpack-browser-config.js:69:26)
at Array.map (<anonymous>)
at generateWebpackConfig (/Volumes/Data/ProjetNodes/TestUpdate/node_modules/@angular-devkit/build-angular/src/utils/webpack-browser-config.js:33:26)
at process._tickCallback (internal/process/next_tick.js:68:7)
at Function.Module.runMain (internal/modules/cjs/loader.js:832:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
Could someone explain my wrongdoing?
Here the modules version used before update:
"dependencies": {
"sqlite3": "^4.0.9",
"typeorm": "^0.2.18"
},
"devDependencies": {
"@angular-builders/custom-webpack": "^8.0.2",
"@angular-devkit/architect": "^0.800.3",
"@angular-devkit/build-angular": "^0.800.3",
"@angular-devkit/core": "^8.0.3",
"@angular/animations": "^8.0.1",
"@angular/cdk": "^8.0.1",
"@angular/cli": "~8.0.3",
"@angular/common": "^8.0.1",
"@angular/compiler": "^8.0.1",
"@angular/compiler-cli": "^8.0.1",
"@angular/core": "^8.0.1",
"@angular/forms": "^8.0.1",
"@angular/http": "^7.0.0",
"@angular/language-service": "^8.0.1",
"@angular/material": "^8.0.1",
"@angular/platform-browser": "^8.0.1",
"@angular/platform-browser-dynamic": "^8.0.1",
"@angular/router": "^8.0.1",
"@types/node": "~12.0.8",
"angular-cli-builders": "^2.1.2",
"codelyzer": "~5.1.0",
"commonjs": "0.0.1",
"copy-webpack-plugin": "^5.0.3",
"core-js": "^3.1.4",
"electron": "^5.0.4",
"electron-builder": "^20.44.2",
"electron-reload": "^1.4.0",
"fs": "0.0.1-security",
"hammerjs": "^2.0.8",
"npm-run-all": "4.1.5",
"npx": "^10.2.0",
"rxjs": "^6.5.2",
"stream": "0.0.2",
"ts-node": "~8.3.0",
"tslint": "~5.17.0",
"typescript": "^3.4.5",
"wait-on": "3.2.0",
"webpack": "^4.34.0",
"zone.js": "^0.9.1"
}
The version after update:
"dependencies": {
"sqlite3": "^4.1.1",
"typeorm": "^0.2.22"
},
"devDependencies": {
"@angular-builders/custom-webpack": "^8.4.1",
"@angular-devkit/architect": "^0.800.6",
"@angular-devkit/build-angular": "^0.803.25",
"@angular-devkit/core": "^8.3.25",
"@angular/animations": "^8.2.14",
"@angular/cdk": "^8.2.3",
"@angular/cli": "~8.3.25",
"@angular/common": "^8.2.14",
"@angular/compiler": "^8.2.14",
"@angular/compiler-cli": "^8.2.14",
"@angular/core": "^8.2.14",
"@angular/forms": "^8.2.14",
"@angular/http": "^7.2.16",
"@angular/language-service": "^8.2.14",
"@angular/material": "^8.2.3",
"@angular/platform-browser": "^8.2.14",
"@angular/platform-browser-dynamic": "^8.2.14",
"@angular/router": "^8.2.14",
"@types/node": "^12.0.12",
"angular-cli-builders": "^2.1.2",
"codelyzer": "^5.1.2",
"commonjs": "0.0.1",
"copy-webpack-plugin": "^5.1.1",
"core-js": "^3.6.4",
"electron": "^5.0.13",
"electron-builder": "^20.44.4",
"electron-reload": "^1.5.0",
"fs": "0.0.1-security",
"hammerjs": "^2.0.8",
"npm-run-all": "4.1.5",
"npx": "^10.2.2",
"rxjs": "^6.5.4",
"stream": "0.0.2",
"ts-node": "~8.3.0",
"tslint": "~5.17.0",
"typescript": "^3.5.3",
"wait-on": "3.2.0",
"webpack": "^4.41.6",
"zone.js": "^0.9.1"
}
Upvotes: 0
Views: 697
Reputation: 21
To those whom encounter the same issue here is my tournaround. I just add in the "node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/browser.js" file the code :
const path = require("path");
et Voilà. h've a great day
Upvotes: 1