Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5.10.1 has a typo that crashes on load #1516

Closed
chenosaurus opened this issue May 17, 2019 · 13 comments
Closed

5.10.1 has a typo that crashes on load #1516

chenosaurus opened this issue May 17, 2019 · 13 comments
Labels

Comments

@chenosaurus
Copy link

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.

@chenosaurus
Copy link
Author

my test script is simply this:

'use strict'

const Math = require('mathjs')

@harrysarson
Copy link
Collaborator

Hi, which OS are you running?

@chenosaurus
Copy link
Author

OS X 10.14
node v8.9.4

@harrysarson
Copy link
Collaborator

The published npm package has two files in:

/mathjs@5.10.1/lib/function/utils/typeOf.js
/mathjs@5.10.1/lib/function/utils/typeof.js

(see https://unpkg.com/mathjs@5.10.1/lib/function/utils/)

@neuronaut
Copy link

I'm on macOS 10.14.4 and node.js 12.1.0

@harrysarson
Copy link
Collaborator

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.

@harrysarson
Copy link
Collaborator

Yeah, is a mac thing 😨

@chenosaurus
Copy link
Author

Just tested on Linux and it's okay, only crashes on Mac.

@neuronaut
Copy link

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).

@harrysarson
Copy link
Collaborator

@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 🤷‍♂

@harrysarson
Copy link
Collaborator

For the record, I cannot reproduce on linux or windows.

@rcketscientist
Copy link

rcketscientist commented May 18, 2019

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

josdejong added a commit that referenced this issue May 18, 2019
@josdejong
Copy link
Owner

josdejong commented May 18, 2019

Ai! I messed up the v5.10.1 release 😳. Should be fixed now in v5.10.3 via 80fa60f. 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.

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

No branches or pull requests

5 participants