angular / preboot

Coordinate transfer of state from server to client view for isomorphic/universal JavaScript web applications
MIT License
382 stars 51 forks source link

Flattened module structure broke imports on projects that don't contain Angular #79

Closed tstirrat15 closed 6 years ago

tstirrat15 commented 6 years ago

Note: for support questions, please use the Universal Slack Channel or https://gitter.im/angular/universal

Bug


Error: Cannot find module '@angular/core'
    at Function.Module._resolveFilename (module.js:536:15)
    at Function.Module._load (module.js:466:25)
    at Module.require (module.js:579:17)
    at require (internal/module.js:11:18)
    at /usr/src/app/node_modules/preboot/bundles/preboot.umd.js:2:82
    at Object.<anonymous> (/usr/src/app/node_modules/preboot/bundles/preboot.umd.js:5:2)
    at Module._compile (module.js:635:30)
    at Module._compile (/usr/src/app/node_modules/pirates/lib/index.js:91:24)
    at Module._extensions..js (module.js:646:10)
    at Object.newLoader [as .js] (/usr/src/app/node_modules/pirates/lib/index.js:96:7)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Module.require (module.js:579:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/src/app/build/webpack:/external "preboot":1:1)```

It seems that when the structure of the imports was flattened, the imports weren't made... optional? I'm not sure how these sorts of things actually work.

* **If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem** by creating a github repo.

Use preboot in a repo that doesn't contain angular.

* **What is the expected behavior?**

The relevant modules import successfully and the missing peer dependencies are ignored.

* **What is the motivation / use case for changing the behavior?**

See above.

* **Please tell us about your environment:**

- Browser: [all]
- Language: [ ES6/7 | ES5 ]
- OS:  [ Linux ]
- Platform: [NodeJs]

* **Other information** (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)
CaerusKaru commented 6 years ago

Duplicate of #80