NativeScript / NativeScript/nativescript-cli
Testing broken: webpack 4 vs webpack 3 requirement by karma-webpack 3.0.5
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- JavaScript
- Sterne
- 1.1k
- Forks
- 204
- Ø Merge
- 1 T. 9 Std.
- Gemergte PRs (30 T.)
- 8
Beschreibung
Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):
✔ Component nativescript has 7.1.2 version and is up to date.
✔ Component @nativescript/core has 7.1.2 version and is up to date.
✖ Component @nativescript/ios is not installed.
✔ Component @nativescript/android has 7.0.1 version and is up to date
Describe the bug
ns test android fails with this karma error:
ERROR [preprocess]: Can not load "webpack"!
Because webpack 3 can't be installed side by side with webpack 4 (afaik?!). npm install correctly states that the peer dependency for webpack 3 (required by karma-webpack@3.0.5) needs to be installed manually.
"dependencies": {
"@nativescript/core": "~7.1.0",
"@nativescript/theme": "~2.3.0",
"@nativescript/unit-test-runner": "^1.0.2"
},
"devDependencies": {
"@nativescript/android": "7.0.1",
"@nativescript/webpack": "~4.0.0",
"@types/karma-chai": "0.1.2",
"@types/mocha": "8.2.0",
"chai": "4.2.0",
"karma": "6.0.0",
"karma-chai": "0.1.0",
"karma-mocha": "2.0.1",
"karma-nativescript-launcher": "0.4.0",
"karma-webpack": "3.0.5",
"mocha": "8.2.1",
"typescript": "~3.9.0"
},
To Reproduce
ns create karmaissue --template @nativescript/template-blank-ts@7.0.4
cd karmaissue
ns test init --framework mocha
ns test android
Expected behavior
Sample test runs (karma doesn't throw an error)
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, das Problem mit den aufgelisteten Befehlen ns create, ns test init --framework mocha und ns test android zu reproduzieren. Überprüfe die Anforderungen von karma-webpack 3.0.5 und @nativescript/webpack 4.0.0; abgeschlossen ist die Aufgabe, wenn der Beispieltest ohne den Webpack-Preprocessing-Fehler ausgeführt wird.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript, webpack
- Bereich
- cli, testing-qa
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100