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

Crash when using yarn PnP #4

Closed
crubier opened this issue May 26, 2019 · 1 comment · Fixed by #5
Closed

Crash when using yarn PnP #4

crubier opened this issue May 26, 2019 · 1 comment · Fixed by #5

Comments

@crubier
Copy link
Contributor

crubier commented May 26, 2019

When using with:

  • create-react-app toto --use-pnp --typescript
  • yarn add @craco/craco cesium resium craco-cesium
  • yarn start

We have the following crash in the console:

unable to locate 'node_modules/cesium/Build/CesiumUnminified' at '/Users/vincent/Code/cloud/node_modules/cesium/Build/CesiumUnminified'

With this displaying in the react application

Screenshot 2019-05-26 at 10 27 26

ReferenceError: Cesium is not defined
cesium
/Users/vincent/Code/cloud/external "Cesium":1
> 1 | module.exports = Cesium;
View compiled
__webpack_require__
/Users/vincent/Code/cloud/webpack/bootstrap:781
  778 | };
  779 | 
  780 | // Execute the module function
> 781 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
      | ^  782 | 
  783 | // Flag the module as loaded
  784 | module.l = true;
View compiled
fn
/Users/vincent/Code/cloud/webpack/bootstrap:149
  146 | 		);
  147 | 		hotCurrentParents = [];
  148 | 	}
> 149 | 	return __webpack_require__(request);
      | ^  150 | };
  151 | var ObjectFactory = function ObjectFactory(name) {
  152 | 	return {
View compiled
▶ 2 stack frames were collapsed.
__webpack_require__
/Users/vincent/Code/cloud/webpack/bootstrap:781
  778 | };
  779 | 
  780 | // Execute the module function
> 781 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
      | ^  782 | 
  783 | // Flag the module as loaded
  784 | module.l = true;
View compiled
fn
/Users/vincent/Code/cloud/webpack/bootstrap:149
  146 | 		);
  147 | 		hotCurrentParents = [];
  148 | 	}
> 149 | 	return __webpack_require__(request);
      | ^  150 | };
  151 | var ObjectFactory = function ObjectFactory(name) {
  152 | 	return {
View compiled
Module../src/App.tsx
http://localhost:3000/static/js/main.chunk.js:103:64
__webpack_require__
/Users/vincent/Code/cloud/webpack/bootstrap:781
  778 | };
  779 | 
  780 | // Execute the module function
> 781 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
      | ^  782 | 
  783 | // Flag the module as loaded
  784 | module.l = true;
View compiled
fn
/Users/vincent/Code/cloud/webpack/bootstrap:149
  146 | 		);
  147 | 		hotCurrentParents = [];
  148 | 	}
> 149 | 	return __webpack_require__(request);
      | ^  150 | };
  151 | var ObjectFactory = function ObjectFactory(name) {
  152 | 	return {
View compiled
Module../src/index.tsx
http://localhost:3000/static/js/main.chunk.js:239:62
__webpack_require__
/Users/vincent/Code/cloud/webpack/bootstrap:781
  778 | };
  779 | 
  780 | // Execute the module function
> 781 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
      | ^  782 | 
  783 | // Flag the module as loaded
  784 | module.l = true;
View compiled
fn
/Users/vincent/Code/cloud/webpack/bootstrap:149
  146 | 		);
  147 | 		hotCurrentParents = [];
  148 | 	}
> 149 | 	return __webpack_require__(request);
      | ^  150 | };
  151 | var ObjectFactory = function ObjectFactory(name) {
  152 | 	return {
View compiled
0
http://localhost:3000/static/js/main.chunk.js:377:18
__webpack_require__
/Users/vincent/Code/cloud/webpack/bootstrap:781
  778 | };
  779 | 
  780 | // Execute the module function
> 781 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
      | ^  782 | 
  783 | // Flag the module as loaded
  784 | module.l = true;
View compiled
checkDeferredModules
/Users/vincent/Code/cloud/webpack/bootstrap:45
  42 | 	}
  43 | 	if(fulfilled) {
  44 | 		deferredModules.splice(i--, 1);
> 45 | 		result = __webpack_require__(__webpack_require__.s = deferredModule[0]);
     | ^  46 | 	}
  47 | }
  48 | return result;
View compiled
Array.webpackJsonpCallback [as push]
/Users/vincent/Code/cloud/webpack/bootstrap:32
  29 | 	deferredModules.push.apply(deferredModules, executeModules || []);
  30 | 
  31 | 	// run deferred modules when all chunks ready
> 32 | 	return checkDeferredModules();
     | ^  33 | };
  34 | function checkDeferredModules() {
  35 | 	var result;
View compiled
(anonymous function)
http://localhost:3000/static/js/main.chunk.js:1:57

Browser console says

Cesium.js:1 Uncaught SyntaxError: Unexpected token <
localhost/:23 Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://localhost:3000/cesium/Widgets/widgets.css".
external "Cesium":1 Uncaught ReferenceError: Cesium is not defined
    at Object.cesium (external "Cesium":1)
    at __webpack_require__ (bootstrap:781)
    at fn (bootstrap:149)
    at Module.<anonymous> (resium.es.js:1)
    at Module.../../Library/Caches/Yarn/v4/npm-resium-1.4.1-ebf13cc1ac10a8a03a415d59b2ffb79e4abae4cf/node_modules/resium/dist/resium.es.js (resium.es.js:3062)
    at __webpack_require__ (bootstrap:781)
    at fn (bootstrap:149)
    at Module../src/App.tsx (App.css?4b4c:45)
    at __webpack_require__ (bootstrap:781)
    at fn (bootstrap:149)
    at Module../src/index.tsx (index.css?43ab:45)
    at __webpack_require__ (bootstrap:781)
    at fn (bootstrap:149)
    at Object.0 (serviceWorker.ts:143)
    at __webpack_require__ (bootstrap:781)
    at checkDeferredModules (bootstrap:45)
    at Array.webpackJsonpCallback [as push] (bootstrap:32)
    at main.chunk.js:1
cesium @ external "Cesium":1
__webpack_require__ @ bootstrap:781
fn @ bootstrap:149
(anonymous) @ resium.es.js:1
../../Library/Caches/Yarn/v4/npm-resium-1.4.1-ebf13cc1ac10a8a03a415d59b2ffb79e4abae4cf/node_modules/resium/dist/resium.es.js @ resium.es.js:3062
__webpack_require__ @ bootstrap:781
fn @ bootstrap:149
./src/App.tsx @ App.css?4b4c:45
__webpack_require__ @ bootstrap:781
fn @ bootstrap:149
./src/index.tsx @ index.css?43ab:45
__webpack_require__ @ bootstrap:781
fn @ bootstrap:149
0 @ serviceWorker.ts:143
__webpack_require__ @ bootstrap:781
checkDeferredModules @ bootstrap:45
webpackJsonpCallback @ bootstrap:32
(anonymous) @ main.chunk.js:1
webpackHotDevClient.js:120 unable to locate 'node_modules/cesium/Build/CesiumUnminified' at '/Users/vincent/Code/cloud/node_modules/cesium/Build/CesiumUnminified'
printWarnings @ webpackHotDevClient.js:120
handleWarnings @ webpackHotDevClient.js:125
push.../../Library/Caches/Yarn/v4/npm-react-dev-utils-9.0.1-5c03d85a0b2537d0c46af7165c24a7dfb274bef2/node_modules/react-dev-utils/webpackHotDevClient.js.connection.onmessage @ webpackHotDevClient.js:190
push.../../Library/Caches/Yarn/v4/npm-sockjs-client-1.3.0-12fc9d6cb663da5739d3dc5fb6e8687da95cb177/node_modules/sockjs-client/lib/event/eventtarget.js.EventTarget.dispatchEvent @ eventtarget.js:56
(anonymous) @ main.js:282
push.../../Library/Caches/Yarn/v4/npm-sockjs-client-1.3.0-12fc9d6cb663da5739d3dc5fb6e8687da95cb177/node_modules/sockjs-client/lib/main.js.SockJS._transportMessage @ main.js:280
push.../../Library/Caches/Yarn/v4/npm-sockjs-client-1.3.0-12fc9d6cb663da5739d3dc5fb6e8687da95cb177/node_modules/sockjs-client/lib/event/emitter.js.EventEmitter.emit @ emitter.js:53
WebSocketTransport.ws.onmessage @ websocket.js:36
crubier added a commit to crubier/craco-cesium that referenced this issue May 26, 2019
@crubier
Copy link
Contributor Author

crubier commented May 26, 2019

PR here #5

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

Successfully merging a pull request may close this issue.

1 participant