Giter Club home page Giter Club logo

Comments (10)

alexander-akait avatar alexander-akait commented on June 8, 2024 1

@FlamesoFF maybe in some cases response doesn't contain code?

You can rewrite this like:

const code = response.match(/\?code=(.+)$/i);

if (!code[1]) { 
    return reject('No code');
}

return resolve(code[1]);

from terser-webpack-plugin.

alexander-akait avatar alexander-akait commented on June 8, 2024

@FlamesoFF in future please provide full stack of error, thanks

from terser-webpack-plugin.

alexander-akait avatar alexander-akait commented on June 8, 2024

@FlamesoFF problem in your code, after minification you get something like this:

"your-string-here".match(/\?code=(.+)$/i)[1]

And nothing in 1 index. Fix you code.

from terser-webpack-plugin.

f1am3d avatar f1am3d commented on June 8, 2024

@evilebottnawi I added full stack trace and also updated the string for you to understand better.

And nothing in 1 index. Fix you code.

I say again: it is working without minification. Read more carefully before answering, please.

from terser-webpack-plugin.

alexander-akait avatar alexander-akait commented on June 8, 2024

@FlamesoFF error not related to plugin, it is related to your code

from terser-webpack-plugin.

alexander-akait avatar alexander-akait commented on June 8, 2024

We just wrapper around terser and don't modify your code, just uglify using terser

from terser-webpack-plugin.

f1am3d avatar f1am3d commented on June 8, 2024

@evilebottnawi So I need to ask this question in terser repository? Because my code stops working ONLY AFTER MINIFICATION.

from terser-webpack-plugin.

alexander-akait avatar alexander-akait commented on June 8, 2024

@FlamesoFF you just look on you mification code and find what is wrong, if you find what minification doesn't correctly you need create issue in terser repo, if you continue oppressive communication i will ignore you.

Also you provide two lines of code and strange error identity.launchWebAuthFlow (we don't use launchWebAuthFlow in webpack) and it is looks what you written invalid code on your side.

from terser-webpack-plugin.

f1am3d avatar f1am3d commented on June 8, 2024

@evilebottnawi Okay, I'll create the issue there.
My communication has come to this form, because you didn't try to make sense of my issue and rushed to close it. That's not what I expected.

About identity.launchWebAuthFlow, it's not invalid code: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/identity/launchWebAuthFlow

Following code is working without terser:

...
chrome.identity.launchWebAuthFlow({
                    interactive: true,
                    url
                }, response => {
                    let code = response.match(/\?code=(.+)$/i)[1];
                    
                    resolve(code);
                });
...

from terser-webpack-plugin.

f1am3d avatar f1am3d commented on June 8, 2024

@evilebottnawi Ok, i'll try. Thank you for help anyway.

from terser-webpack-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.