blitz-js / legacy-framework

MIT License
3 stars 2 forks source link

Element is not defined - Material UI #459

Closed JoseRFelix closed 4 years ago

JoseRFelix commented 4 years ago

What is the problem?

After merging current canary changes, Material UI example returns Reference Error: Element is not defined on resolution of react-transition-group peer package from material-ui.

This only occurs when trying to develop using monolith since published package works well.

Edit: WIP branch

Steps to Reproduce:

  1. Run blitz start inside Blitz worspace

Versions:

debug: monorepo
debug: pkgPath: /home/jfelix/Documents/programming/open-source/blitz/node_modules/@blitzjs/cli 

Linux 5.3 | linux-x64 | Node: v12.16.1

blitz: 0.9.0 (global)
blitz: 0.9.0 (local)

Supporting Documentation

Error:

ReferenceError: Element is not defined
    at Object.<anonymous> (/home/jfelix/Documents/programming/open-source/blitz/node_modules/react-transition-group/cjs/Transition.js:452:44)
    at Module._compile (internal/modules/cjs/loader.js:1158:30)
    at Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
    at Object.newLoader [as .js] (/home/jfelix/Documents/programming/open-source/blitz/node_modules/pirates/lib/index.js:104:7)
    at Module.load (internal/modules/cjs/loader.js:1002:32)
    at Function.Module._load (internal/modules/cjs/loader.js:901:14)
    at Module.require (internal/modules/cjs/loader.js:1044:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object.<anonymous> (/home/jfelix/Documents/programming/open-source/blitz/node_modules/react-transition-group/cjs/CSSTransition.js:14:42)
    at Module._compile (internal/modules/cjs/loader.js:1158:30)
    at Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
    at Object.newLoader [as .js] (/home/jfelix/Documents/programming/open-source/blitz/node_modules/pirates/lib/index.js:104:7)
    at Module.load (internal/modules/cjs/loader.js:1002:32)
    at Function.Module._load (internal/modules/cjs/loader.js:901:14)
    at Module.require (internal/modules/cjs/loader.js:1044:19)
    at require (internal/modules/cjs/helpers.js:77:18)
ReferenceError: Element is not defined
    at Object.<anonymous> (/home/jfelix/Documents/programming/open-source/blitz/node_modules/react-transition-group/cjs/Transition.js:452:44)
    at Module._compile (internal/modules/cjs/loader.js:1158:30)
    at Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
    at Object.newLoader [as .js] (/home/jfelix/Documents/programming/open-source/blitz/node_modules/pirates/lib/index.js:104:7)
    at Module.load (internal/modules/cjs/loader.js:1002:32)
    at Function.Module._load (internal/modules/cjs/loader.js:901:14)
    at Module.require (internal/modules/cjs/loader.js:1044:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object.<anonymous> (/home/jfelix/Documents/programming/open-source/blitz/node_modules/react-transition-group/cjs/CSSTransition.js:14:42)
    at Module._compile (internal/modules/cjs/loader.js:1158:30)
    at Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
    at Object.newLoader [as .js] (/home/jfelix/Documents/programming/open-source/blitz/node_modules/pirates/lib/index.js:104:7)
    at Module.load (internal/modules/cjs/loader.js:1002:32)
    at Function.Module._load (internal/modules/cjs/loader.js:901:14)
    at Module.require (internal/modules/cjs/loader.js:1044:19)
    at require (internal/modules/cjs/helpers.js:77:18)
cktang88 commented 4 years ago

This doesn't seem to be a blitz-specific issue, seems to likely be Next.js related https://github.com/mui-org/material-ui/issues/20929

flybayer commented 4 years ago

@JoseRFelix I'm going to go ahead and close this, especially since you said it works fine for published packages.

If you still have the issue try this workaround: https://github.com/mui-org/material-ui/issues/20924#issuecomment-624342438