Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

change tsb.create(string) to tsb.create(require(string)) #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

olegchir
Copy link

Fixes an error on OSX 10.11 + latest node / gulp-tsb.
There's no string-arg version of tsb.create anymore.

Example of the error before this fix:

➜  node-express-typescript git:(master) gulp build
{ file: undefined,
  start: undefined,
  length: undefined,
  messageText: 'Failed to parse file \'src/tsconfig.json\': text.charCodeAt is not a function.',
  category: 1,
  code: 5014 }
{ file: undefined,
  start: undefined,
  length: undefined,
  messageText: 'Failed to parse file \'tests/tsconfig.json\': text.charCodeAt is not a function.',
  category: 1,
  code: 5014 }
[20:26:08] Using gulpfile /Volumes/data/testapps/vscode-samples/node-express-typescript/gulpfile.js
[20:26:08] Starting 'build'...
[20:26:08] 'build' errored after 12 ms
[20:26:08] TypeError: Cannot read property 'on' of null
    at DestroyableTransform.Readable.pipe (/Volumes/data/testapps/vscode-samples/node-express-typescript/node_modules/gulp/node_modules/vinyl-fs/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:516:7)
    at Gulp.<anonymous> (/Volumes/data/testapps/vscode-samples/node-express-typescript/gulpfile.js:65:10)
    at module.exports (/Volumes/data/testapps/vscode-samples/node-express-typescript/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:34:7)
    at Gulp.Orchestrator._runTask (/Volumes/data/testapps/vscode-samples/node-express-typescript/node_modules/gulp/node_modules/orchestrator/index.js:273:3)
    at Gulp.Orchestrator._runStep (/Volumes/data/testapps/vscode-samples/node-express-typescript/node_modules/gulp/node_modules/orchestrator/index.js:214:10)
    at Gulp.Orchestrator.start (/Volumes/data/testapps/vscode-samples/node-express-typescript/node_modules/gulp/node_modules/orchestrator/index.js:134:8)
    at /usr/local/lib/node_modules/gulp/bin/gulp.js:129:20
    at nextTickCallbackWith0Args (node.js:420:9)
    at process._tickCallback (node.js:349:13)
    at Function.Module.runMain (module.js:443:11)

And after this fix:

➜  node-express-typescript git:(gulp-tsb-require) gulp build
[20:34:11] Using gulpfile /Volumes/data/git/vscode-samples/node-express-typescript/gulpfile.js
[20:34:11] Starting 'build'...
"/Volumes/data/git/vscode-samples/node-express-typescript/src/routes/index.ts(1,1): Cannot compile modules unless the '--module' flag is provided with a valid module type. Consider setting the 'module' compiler option in a 'tsconfig.json' file."
[20:34:12] Finished 'build' after 1.02 s

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant