Skip to content

Conversation

ericdevries
Copy link

This PR contains a:

  • [x ] bugfix
  • new feature
  • code refactor
  • test update
  • typo fix
  • metadata update

Motivation / Use-Case

Rendering bundles targetting nodejs rather than a browser still inserts javascript that assumes it will be executed in an environment that has document defined.

Breaking Changes

Additional Info

@jsf-clabot
Copy link

jsf-clabot commented May 16, 2018

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (typeof document !== "object") throw new Error("The mini-css-extract-plugin cannot be used in a non-browser environment");

@alexander-akait
Copy link
Member

Also please accept CLA

@michael-ciniawsky michael-ciniawsky changed the title Do not check for html <head> content if document is undefined fix(index): check if document is defined Aug 6, 2018
@michael-ciniawsky michael-ciniawsky added this to the 0.4.2 milestone Aug 6, 2018
@prate3k
Copy link

prate3k commented Nov 6, 2018

@evilebottnawi / @michael-ciniawsky : Whats the alternative here then for ssr build? AFAIK adding document !== undefined check will only prevent server build from throwing error.

@alexander-akait
Copy link
Member

@prate3k sorry for delay, problem still exists?

@alexander-akait
Copy link
Member

Do not run plugin in non browsers env, if you have problem with SSR please open new issue with reproducible test repo, thanks

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants