stealjs / steal-tools

Build easy. Load fast.
https://stealjs.com/docs/steal-tools.html
MIT License
67 stars 23 forks source link

Could not load 'BABYLON' #1094

Open justinbmeyer opened 5 years ago

justinbmeyer commented 5 years ago

I'm unable to build the egowall project because of cryptic message:

Could not load 'BABYLON'

Ideally, I'd like:

As far as I can tell, this warning is not from babylon. The app loads fine in development. If I build smaller parts of the app that do use babylon, everything works.

I'm trying to create a minimal breaking case.

The import looks like:

import BABYLON from 'babylonjs/dist/preview release/babylon.max.js';
justinbmeyer commented 5 years ago

To workaround this bug, I had to install babylonjs in my main app. babylonjs is a dependency of a sub-project. I'm not sure why this was necessary.

justinbmeyer commented 5 years ago

This can be duplicated by creating a sub project with "babylonjs": "^3.1.1", as a dependency. The sub-project should import that dependency as:

import BABYLON from 'babylonjs/dist/preview release/babylon.max.js';

With the following meta config:

      "babylonjs/dist/preview release/babylon.max.js": {
        "format": "global"
      }

Then make the main project import the sub project.

matthewp commented 5 years ago

The space in the url is odd and something we likely don't have tests for. I wonder if there's a difference in Node vs browser there. Although the way the bug manifests I'm not sure why adding the package as a dependency fixes it.