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

u3 package is broken #593

Closed
vans163 opened this issue May 18, 2021 · 5 comments
Closed

u3 package is broken #593

vans163 opened this issue May 18, 2021 · 5 comments
Labels
bug Something isn't working dependencies Pull requests that update a dependency file devx P2 Pretty important

Comments

@vans163
Copy link

vans163 commented May 18, 2021

[!] (plugin commonjs) SyntaxError: Deleting local variable in strict mode (8:8) in 
../node_modules/u3/lib/cache.js
node_modules/u3/lib/cache.js (8:8)

It seems the u3 package used is outdated and does not follow modern javascript rules.

Also is there a way to build a static non-browser build (so no window. is included)?

@vans163 vans163 added the bug Something isn't working label May 18, 2021
@mehtaphysical
Copy link
Contributor

It doesn't seem like this codebase uses u3. It's not in our yarn.lock. Are you maybe using a different dependency that uses it?

@thanhlmm
Copy link

thanhlmm commented May 19, 2021

@vans163 I face the same problem, so I need to override the u3 package by using patch-package

Here is the modified one

var cache = function (fn) {
    var called = false,
        store;

    if (!(fn instanceof Function)) {
        called = true;
        store = fn;
        fn = null;
    }

    return function () {
        if (!called) {
            called = true;
            store = fn.apply(this, arguments);
            fn = null;
        }
        return store;
    };
};

module.exports = cache;

@volovyks
Copy link
Collaborator

@mehtaphysical looks like it is in our lock file and dependency tree. Try npm list --depth=1 to find it. It's a dependency of error-polyfill, but both error-polyfill and u3 have the latest versions from npm.

@mehtaphysical
Copy link
Contributor

@volovyk-s I see. We should consider removing this dependency. According to their GitHub repo it is:

INACTIVE (unstable) - Javascript Error Polyfill - Implementing the V8 Error API in non-V8 environments as much as possible

@volovyks volovyks linked a pull request May 19, 2021 that will close this issue
@ghost ghost mentioned this issue May 28, 2021
@volovyks volovyks added dependencies Pull requests that update a dependency file devx P2 Pretty important labels Jun 7, 2021
@volovyks
Copy link
Collaborator

@vans163 error-polyfill was updated and now we are using the latest version. The same goes for u3.
https://www.npmjs.com/package/u3
https://www.npmjs.com/package/error-polyfill
Please, reopen if you are still encountering any problems with these dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dependencies Pull requests that update a dependency file devx P2 Pretty important
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants