Pnpjs: Error: tools/buildsystem/src/tasks/build/copy-assets.ts(20,17): error TS2345: Argument of type '{ overwrite: boolean; }' is not assignable to parameter of type 'DestOptions'.

Created on 30 May 2018  路  12Comments  路  Source: pnp/pnpjs

Category

  • [ ] Enhancement
  • [X] Bug
  • [ ] Question
  • [ ] Documentation gap/issue

Version

Please specify what version of the library you are using: [1.1.0]

Steps to Reproduce

Expected / Desired Behavior / Question

  • Js files compiled

Observed Behavior

Getting the following error. Here is the full stack.

C:\p\pnpjs (master)
位 npm install -g gulp-cli
C:\Users\xx\AppData\Roaming\npm\gulp -> C:\Users\xx\AppData\Roaming\npm\node_modules\gulp-cli\bin\gulp.js
+ [email protected]
updated 1 package in 104.167s

C:\p\pnpjs (master)
位 gulp build
[15:14:50] Using gulpfile C:\p\pnpjs\gulpfile.js
[15:14:50] Starting 'clean'...
[15:14:50]   Cleaning directories: ./build, ./dist, ./debugging, ./serve, ./testing.
[15:14:50] Starting 'lint'...
[15:14:52] Starting 'bootstrap-buildsystem'...
[15:14:53]   Cleaned directories: ./build, ./dist, ./debugging, ./serve, ./testing.
[15:14:53] Finished 'clean' after 3.32 s
[15:14:57] Finished 'lint' after 6.8 s
[15:14:57] 'bootstrap-buildsystem' errored after 5.65 s
[15:14:57] Error: tools/buildsystem/src/tasks/build/copy-assets.ts(20,17): error TS2345: Argument of type '{ overwrite: boolean; }' is not assignable to parameter of type 'DestOptions'.
  Object literal may only specify known properties, and 'overwrite' does not exist in type 'DestOptions'.
tools/buildsystem/src/tasks/build/copy-package-file.ts(23,17): error TS2345: Argument of type '{ overwrite: boolean; }' is not assignable to parameter of type 'DestOptions'.
  Object literal may only specify known properties, and 'overwrite' does not exist in type 'DestOptions'.
tools/buildsystem/src/tasks/build/replace-debug.ts(24,17): error TS2345: Argument of type '{ overwrite: boolean; }' is not assignable to parameter of type 'DestOptions'.
  Object literal may only specify known properties, and 'overwrite' does not exist in type 'DestOptions'.
tools/buildsystem/src/tasks/build/replace-sp-http-version.ts(30,17): error TS2345: Argument of type '{ overwrite: boolean; }' is not assignable to parameter of type 'DestOptions'.
  Object literal may only specify known properties, and 'overwrite' does not exist in type 'DestOptions'.
tools/buildsystem/src/tasks/package/banner.ts(43,17): error TS2345: Argument of type '{ cwd: string; overwrite: boolean; }' is not assignable to parameter of type 'DestOptions'.
  Object literal may only specify known properties, and 'overwrite' does not exist in type 'DestOptions'.
tools/buildsystem/src/tasks/package/copy-assets.ts(20,17): error TS2345: Argument of type '{ overwrite: boolean; }' is not assignable to parameter of type 'DestOptions'.
  Object literal may only specify known properties, and 'overwrite' does not exist in type 'DestOptions'.
tools/buildsystem/src/tasks/package/copy-src.ts(21,17): error TS2345: Argument of type '{ overwrite: boolean; }' is not assignable to parameter of type 'DestOptions'.
  Object literal may only specify known properties, and 'overwrite' does not exist in type 'DestOptions'.

    at formatError (C:\Users\xx\AppData\Roaming\npm\node_modules\gulp-cli\lib\versioned\^3.7.0\format-error.js:20:10)
    at Gulp.<anonymous> (C:\Users\xx\AppData\Roaming\npm\node_modules\gulp-cli\lib\versioned\^3.7.0\log\events.js:41:15)
    at emitOne (events.js:116:13)
    at Gulp.emit (events.js:211:7)
    at Gulp.Orchestrator._emitTaskDone (C:\p\pnpjs\node_modules\orchestrator\index.js:264:8)
    at C:\p\pnpjs\node_modules\orchestrator\index.js:275:23
    at finish (C:\p\pnpjs\node_modules\orchestrator\lib\runTask.js:21:8)
    at cb (C:\p\pnpjs\node_modules\orchestrator\lib\runTask.js:29:3)
    at exec (C:\p\pnpjs\tools\gulptasks\build.js:37:13)
    at ChildProcess.exithandler (child_process.js:282:5)

Additional

  • I am using windows 7 enterprise
  • I have python 2.7.13 installed
tooling details needed question

Most helpful comment

Sure will try it asap

All 12 comments

Hi, did you execute npm install first?

I did. gulp serve worked, however gulp build did not.

Build works for me, yet with some weirdies:

image

After running tsc in ./tools/buildsystem, everything went as usual.

However, I experience no issues in tools/buildsystem/src/tasks/build/copy-assets.ts, dest's parameters.

I've been using these commands for months and haven't seen an issue. What version of node and gulp global are you running?

Works for me now. The only think I changed was upgrade from npm 5.2.0 to npm 5.10.0 and windows RESTART :)

C:\p\pnpjs (master)
位 node --version
v8.9.1

C:\p\pnpjs (master)
位 npm --version
5.10.0

C:\p\pnpjs (master)
位 npm -g list --depth=0
C:\Users\xx\AppData\Roaming\npm
...
+-- [email protected]
+-- [email protected]
+-- [email protected]
...

I will close that issue. Feel free to reopen it if someone else has the same issue.

Weird - no idea what would have caused this. Let us know if you run into any more issues, and thanks!

having similar problem with macOS
$ node --version
v9.10.1
npm --version
6.1.0

$ gulp build
[23:40:14] Using gulpfile ~/development/pnpjs/gulpfile.js
[23:40:14] Starting 'clean'...
[23:40:14] Cleaning directories: ./build, ./dist, ./debugging, ./serve, ./testing.
[23:40:14] Starting 'lint'...
[23:40:15] Starting 'bootstrap-buildsystem'...
[23:40:15] Finished 'bootstrap-buildsystem' after 14 ms
[23:40:15] Cleaned directories: ./build, ./dist, ./debugging, ./serve, ./testing.
[23:40:15] Finished 'clean' after 1.2 s
[23:40:16] Finished 'lint' after 2.45 s
[23:40:16] Starting 'build'...
[23:40:16] 'build' errored after 398 渭s
[23:40:16] Error: Cannot find module '/Users/tomi/development/pnpjs/build/tools/buildsystem'
at Function.Module._resolveFilename (module.js:543:15)
at Function.Module._load (module.js:470:25)
at Module.require (module.js:593:17)
at require (internal/module.js:11:18)
at Gulp.gulp.task (/Users/tomi/development/pnpjs/tools/gulptasks/build.js:48:20)
at module.exports (/Users/tomi/development/pnpjs/node_modules/orchestrator/lib/runTask.js:34:7)
at Gulp.Orchestrator._runTask (/Users/tomi/development/pnpjs/node_modules/orchestrator/index.js:273:3)
at Gulp.Orchestrator._runStep (/Users/tomi/development/pnpjs/node_modules/orchestrator/index.js:214:10)
at /Users/tomi/development/pnpjs/node_modules/orchestrator/index.js:279:18
at finish (/Users/tomi/development/pnpjs/node_modules/orchestrator/lib/runTask.js:21:8)

Looks like this [23:47:55] Error: Cannot find module '/Users/tomi/development/pnpjs/build/tools/buildsystem'
That build folder does not exist.

@tavikukko, I reopened the issue for visibility. @patrick-rodgers , @koltyakov tagged.

@VelinGeorgiev - can you pull @tavikukko 's updates and see if this fixes things for you as well? When I merge I will also take a look at the other gulp tasks to see if this is an issue in other places.

To summarize this seems entirely to be an issue across platforms? Want to ensure we aren't being impacted by version differences in something. Thanks folks!

Sure will try it asap

When I was working on setting up the CI stuff tonight I did find a race condition where if the buildsystem was built too fast clean would remove it before it was used. So I think I have that fixed with the proper gulp dependencies. Perhaps that was also part of the problem here. Anyway, do let us know if you are still having issues. Thanks!

Was this page helpful?
0 / 5 - 0 ratings