triniwiz / nativescript-plugins

Apache License 2.0
78 stars 50 forks source link

pager and image-cache-it: webpack build error after upgrade to @nativescript/core 8.4.x #152

Closed felixkrautschuk closed 1 year ago

felixkrautschuk commented 1 year ago

After upgrading the project to nativescript/core 8.4.1 (or 8.4.0), the project is not getting built anymore:

ERROR in ./node_modules/@triniwiz/nativescript-image-cache-it/common.js 9:0-113 Module not found: Error: Can't resolve '@nativescript/core/utils/utils' in '/Users/felixkrautschuk/Downloads/test/node_modules/@triniwiz/nativescript-image-cache-it' @ ./node_modules/@triniwiz/nativescript-image-cache-it/index.android.js 12:0-35 13:0-82 38:34-50 149:5-29 172:5-35 204:5-38 218:5-41 232:5-41 235:5-34 263:5-33 266:5-39 267:15-37 269:5-38 273:17-37 276:17-36 284:5-40 287:5-39 295:5-38 309:5-37 344:5-36 347:5-38 369:5-37 @ ./app/main-page.xml 15:7-123 19:7-123 @ ./app/ sync .(xml%7Cjs%7C(?<%21.d.)ts%7Cs?css)$ ./main-page.xml @ ./node_modules/@nativescript/webpack/dist/stubs/virtual-entry-typescript.js 3:16-103

ERROR in ./node_modules/@triniwiz/nativescript-pager/common.js 5:16-57 Module not found: Error: Can't resolve '@nativescript/core/utils/utils' in '/Users/felixkrautschuk/Downloads/test/node_modules/@triniwiz/nativescript-pager' @ ./node_modules/@triniwiz/nativescript-pager/index.android.js 13:0-377 14:0-25 14:0-25 15:0-39 15:0-39 29:27-36 205:5-30 208:5-30 211:5-32 217:17-31 220:17-31 223:17-31 226:17-31 229:17-36 245:32-49 290:5-37 300:5-45 310:5-35 315:5-29 318:5-28 331:16-44 337:16-44 361:16-44 371:5-36 418:5-37 421:5-36 431:5-36 453:29-38 459:5-34 516:5-31 519:5-36 624:42-55 673:24-63 682:24-63 686:24-63 690:20-59 768:27-38 875:27-38 @ ./app/main-page.xml 3:7-114 7:7-114 11:7-114 @ ./app/ sync .(xml%7Cjs%7C(?<%21.d.)ts%7Cs?css)$ ./main-page.xml @ ./node_modules/@nativescript/webpack/dist/stubs/virtual-entry-typescript.js 3:16-103

ERROR in ./node_modules/@triniwiz/nativescript-pager/index.android.js 12:0-56 Module not found: Error: Can't resolve '@nativescript/core/utils/utils' in '/Users/felixkrautschuk/Downloads/test/node_modules/@triniwiz/nativescript-pager' @ ./app/main-page.xml 3:7-114 7:7-114 11:7-114 @ ./app/ sync .(xml%7Cjs%7C(?<%21.d.)ts%7Cs?css)$ ./main-page.xml @ ./node_modules/@nativescript/webpack/dist/stubs/virtual-entry-typescript.js 3:16-103

3 errors have detailed information that is not shown. Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.

webpack 5.75.0 compiled with 3 errors in 140 ms

"dependencies": {
  "@nativescript/core": "^8.4.1",
  "@triniwiz/nativescript-image-cache-it": "^7.0.20",
  "@triniwiz/nativescript-pager": "^14.0.1"
},
"devDependencies": {
  "@nativescript/android": "^8.4.0",
  "@nativescript/ios": "^8.4.0",
  "@nativescript/types": "~8.4.0",
  "@nativescript/webpack": "^5.0.12",
  "typescript": "~4.8.4"
}

Sample app: test.zip

Actually we have to stick with nativescript-pager 13.0.1 due to this issue: https://github.com/triniwiz/nativescript-plugins/issues/138 But I guess a fix will only get included into v14 .... :/

brianrclow commented 1 year ago

Hi @felixkrautschuk - it looks like triniwiz/nativescript-image-cache-it was just updated. Try 7.0.19 and this should resolve your issue with nativescript-image-cache-it and the utils errors.

guillemc23 commented 1 year ago

This happened to me too. I went inside the common.js file and changed line 9 to:

import { isDataURI, isFileOrResourcePath, isFontIconURI, RESOURCE_PREFIX } from "@nativescript/core/utils";

What's weird is that I'm using version 7.1.0 which shouldn't have been released yet 🤔 According to npm the last version should be 7.0.19

triniwiz commented 1 year ago

Fixed in 7.2.0