After installing 5.10.1, there's crash immediately on load.
/Users/dchen/workspace/gnss-lib/node_modules/mathjs/lib/function/utils/typeof.js:98
exports.createDeprecatedTypeof = createDeprecatedTypeof;mber';
^^
SyntaxError: Invalid or unexpected token
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:607:28)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
at Module.require (module.js:587:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/Users/dchen/workspace/gnss-lib/node_modules/mathjs/lib/function/utils/index.js:3:230)
If I rollback to 5.10.0, everything works.
my test script is simply this:
'use strict'
const Math = require('mathjs')
Hi, which OS are you running?
OS X 10.14
node v8.9.4
The published npm package has two files in:
/[email protected]/lib/function/utils/typeOf.js
/[email protected]/lib/function/utils/typeof.js
(see https://unpkg.com/[email protected]/lib/function/utils/)
I'm on macOS 10.14.4 and node.js 12.1.0
I have no idea how these two files got there but I think they are the cause of the bug, it will only show up on certain file systems which are case sensitive. I think mac OS is case sensitive.
Yeah, is a mac thing 馃槰
Just tested on Linux and it's okay, only crashes on Mac.
macOS's filesystem isn't case sensitive (unless you enable that) so typeof.js is probably overwriting typeOf.js (I only have the lowercase version).
@josdejong something went wrong during the release. Hopefully the following will fix:
This is some sort of build error. @chenosaurus @neuronaut @chenosaurus for now pin your version of mathjs at 5.10.0 we can hope for the best in the morning 馃し鈥嶁檪
For the record, I cannot reproduce on linux or windows.
I'm seeing the same thing. #1517 is also the same error, but with the garbage reporting of Karma3.
ERROR in C:/Keysight/Development/ioncore/ion-ng/node_modules/mathjs/lib/function/utils/typeof.js 98:60
Module parse failed: Unterminated string constant (98:60)
You may need an appropriate loader to handle this file type.
| };
| });
> exports.createDeprecatedTypeof = createDeprecatedTypeof;mber';
| if (type.isComplex(x)) return 'Complex';
| if (type.isFraction(x)) return 'Fraction';
@ C:/Keysight/Development/ioncore/ion-ng/node_modules/mathjs/lib/type/numeric.js 4:23-58
@ C:/Keysight/Development/ioncore/ion-ng/node_modules/mathjs/lib/type/index.js
@ C:/Keysight/Development/ioncore/ion-ng/node_modules/mathjs/lib/index.js
@ C:/Keysight/Development/ioncore/ion-ng/node_modules/mathjs/lib/main.js
@ C:/Keysight/Development/ioncore/ion-ng/node_modules/mathjs/index.js
Ai! I messed up the v5.10.1 release :flushed:. Should be fixed now in v5.10.3 via https://github.com/josdejong/mathjs/commit/80fa60f75da0dfe5faacd0943804e9fc6dc6496b. Sorry for the trouble!
The cause was that the build script did not clean the build folders (lib and dist) before building. This never led to issues because renaming files hardly happened and even if there where left over files they where simply hanging there, not in use. But for the upcoming v6 I've renamed typeof.js to typeOf.js. I already encountered the issue of having these two files in the lib/functions/utils folder, and added a clean script in v6. But I didn't do that in v5, so when switching back to v5 yesterday for a bug fix release, there where two versions of the file in the lib folder again. I'm running Linux so I didn't detect this.
Now both v5 and the upcoming v6 are neatly cleaning their build folders every time, so this issue cannot occur anymore.
Most helpful comment
Ai! I messed up the
v5.10.1release :flushed:. Should be fixed now inv5.10.3via https://github.com/josdejong/mathjs/commit/80fa60f75da0dfe5faacd0943804e9fc6dc6496b. Sorry for the trouble!The cause was that the build script did not clean the build folders (
libanddist) before building. This never led to issues because renaming files hardly happened and even if there where left over files they where simply hanging there, not in use. But for the upcoming v6 I've renamedtypeof.jstotypeOf.js. I already encountered the issue of having these two files in thelib/functions/utilsfolder, and added acleanscript in v6. But I didn't do that in v5, so when switching back to v5 yesterday for a bug fix release, there where two versions of the file in thelibfolder again. I'm running Linux so I didn't detect this.Now both v5 and the upcoming v6 are neatly cleaning their build folders every time, so this issue cannot occur anymore.