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

Breaking change after updating to 1.8.x (from 1.7.5) #2354

Closed
AlexanderOpran opened this issue Sep 9, 2020 · 6 comments · Fixed by #2368
Closed

Breaking change after updating to 1.8.x (from 1.7.5) #2354

AlexanderOpran opened this issue Sep 9, 2020 · 6 comments · Fixed by #2368

Comments

@AlexanderOpran
Copy link

We have an Angular 10 project in which we are using TailwindCSS and we are also using resolveConfig. After updating to 1.8 we are getting a critical breaking change error (Uncaught ReferenceError: global is not defined). We have narrowed this down to the usage of the resolveConfig (if we do not use resolveConfig everything works fine even on 1.8). The error itself seems to be somehow related to the postcss-selector-parser package.

We can do a temporary workaround using things like:

(window as any).global = window;

in polyfills.ts but nevertheless, I do not think this should be an issue.

@jacobdalamb
Copy link

You should check out v1.8.5 pretty sure it fixed that

@adamwathan
Copy link
Member

Hey sorry to hear about this! Can you please provide a GitHub repo that reproduces the issue so we can more easily troubleshoot and diagnose the issue?

@AlexanderOpran
Copy link
Author

AlexanderOpran commented Sep 9, 2020

Hey Adam,

Thanks for the quick response. I cannot exactly share the repository but a regular angular 10 cli project + tailwind will have the exact same issues after build. I will try and do that if need be.

One additional thing, this issue cannot be reproduced by running the project locally with the development webserver, it will only be an issue after the build (so perhaps test that using docker or a regular webserver).

@benji014628, tried updating the package to the latest version (1.8.6), sadly we have the same issue.

image

Caused by postcss-selector-parser trying to call a node util (deprecate) and as such, global.deprecate.

This is what is causing the issue (from postcss-selector-parser):

var _require = require("util"),
    deprecate = _require.deprecate;

var WRAPPED_IN_QUOTES = /^('|")(.*)\1$/;
var warnOfDeprecatedValueAssignment = deprecate(function () {}, "Assigning an attribute a value containing characters that might need to be escaped is deprecated. " + "Call attribute.setValue() instead.");
var warnOfDeprecatedQuotedAssignment = deprecate(function () {}, "Assigning attr.quoted is deprecated and has no effect. Assign to attr.quoteMark instead.");
var warnOfDeprecatedConstructor = deprecate(function () {}, "Constructing an Attribute selector with a value without specifying quoteMark is deprecated. Note: The value should be unescaped now.");

@adamwathan
Copy link
Member

Can you share a GitHub repository you create that reproduces the issue? It doesn't have to be your actual work project. Just something so I don't have to set it up from scratch myself.

@AlexanderOpran
Copy link
Author

AlexanderOpran commented Sep 9, 2020

Hey @adamwathan,

I created a repository and reproduced the issue. https://github.com/AlexanderOpran/angular-tailwind-debug

Just run npm install and npm start. If you downgrade to 1.7.5 the issue will go away. Same if you remove the resolveConfig.

Funnily enough, in the larger project I can only reproduce this issue after the build not on local (ng serve) but in that repo above the issue is also happening on local. Not sure why, but nevertheless, same issue.

Please let me know if I can help with anything else. 😸

I tested every version available and it seems the issue starts appearing from version 1.7.6 onwards.

@adamwathan
Copy link
Member

Should be fixed in v1.8.8 👍

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

Successfully merging a pull request may close this issue.

3 participants