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

Cannot compile from sources #1173

Closed
patriotyk opened this issue Nov 22, 2021 · 4 comments
Closed

Cannot compile from sources #1173

patriotyk opened this issue Nov 22, 2021 · 4 comments
Labels

Comments

@patriotyk
Copy link

I just tried to compile latest(15.5.0) version and got an following error:

patriotyk@patriotyk-Mi-Laptop-Pro-15:~/Downloads/noUiSlider-15.5.0$ npm install

added 211 packages, and audited 212 packages in 2s

2 low severity vulnerabilities

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
patriotyk@patriotyk-Mi-Laptop-Pro-15:~/Downloads/noUiSlider-15.5.0$ npm run build

> [email protected] build
> npm run build:mjs && npm run build:js && npm run build:styles


> [email protected] build:mjs
> tsc --module ES6 && mv dist/nouislider.js dist/nouislider.mjs


> [email protected] build:js
> npm run build:js:write && npm run build:js:compress && npm run build:js:compress:mjs


> [email protected] build:js:write
> rollup -c rollup.config.js


src/nouislider.ts → dist/nouislider.js...
(node:949895) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at /home/patriotyk/Downloads/noUiSlider-15.5.0/node_modules/rollup-plugin-typescript2/node_modules/tslib/package.json.
Update this package.json to use a subpath pattern like "./*".
(Use `node --trace-deprecation ...` to show where the warning was created)
created dist/nouislider.js in 1.4s

> [email protected] build:js:compress
> uglifyjs dist/nouislider.js --compress --mangle --output dist/nouislider.min.js


> [email protected] build:js:compress:mjs
> uglifyjs dist/nouislider.mjs --compress --mangle --output dist/nouislider.min.mjs

Parse error at dist/nouislider.mjs:2,7
export var PipsMode;
       ^
ERROR: Unexpected token: keyword (var)
    at JS_Parse_Error.get (eval at <anonymous> (/home/patriotyk/Downloads/noUiSlider-15.5.0/node_modules/uglify-js/tools/node.js:20:1), <anonymous>:71:23)
    at fatal (/home/patriotyk/Downloads/noUiSlider-15.5.0/node_modules/uglify-js/bin/uglifyjs:291:53)
    at run (/home/patriotyk/Downloads/noUiSlider-15.5.0/node_modules/uglify-js/bin/uglifyjs:235:9)
    at Object.<anonymous> (/home/patriotyk/Downloads/noUiSlider-15.5.0/node_modules/uglify-js/bin/uglifyjs:160:5)
    at Module._compile (node:internal/modules/cjs/loader:1109:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10)
    at Module.load (node:internal/modules/cjs/loader:989:32)
    at Function.Module._load (node:internal/modules/cjs/loader:829:14)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)
    at node:internal/main/run_main_module:17:47

patriotyk@patriotyk-Mi-Laptop-Pro-15:~/Downloads/noUiSlider-15.5.0$ npm -v
7.13.0
patriotyk@patriotyk-Mi-Laptop-Pro-15:~/Downloads/noUiSlider-15.5.0$ node -v
v16.2.0
patriotyk@patriotyk-Mi-Laptop-Pro-15:~/Downloads/noUiSlider-15.5.0$ 


@leongersen
Copy link
Owner

I don't have any immediate pointers as to what's going wrong here, but my first guess is in the node.js versions; I'm still on Node 12 LTS.

@andrewstart
Copy link

It looks like updating uglify-js fixes the issue - recent patch notes do mention some work around handing Typescript's enums.

@leongersen
Copy link
Owner

I've updated the devDependencies. Thank you for contributing!

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants