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

bundling locally defined module #590

Closed
simonfox opened this issue Apr 5, 2017 · 1 comment
Closed

bundling locally defined module #590

simonfox opened this issue Apr 5, 2017 · 1 comment

Comments

@simonfox
Copy link
Contributor

simonfox commented Apr 5, 2017

  • Library Version:
    0.27.0

  • Operating System:
    Windows 10

  • Node Version:
    6.2.1

  • NPM Version:
    4.5

  • Language:
    all

I'm trying to add npm:[email protected] to my project. This package is a node package, but provides an optional browser implementation. I've seen the approach described in aurelia/animator-velocity#13 and am trying to follow that to attempt to create a local module that uses the browser implementation of uuid.

Problem is the bundler doesn't seem to like the dependency path in aurelia.json:

{
  "name": "uuid-shim",
  "path": "../scripts/uuid-shim"
}

I get the following exception:

{ uid: 9,
  name: 'writeBundles',
  branch: false,
  error:
   TypeError: Path must be a string. Received undefined
       at assertPath (path.js:7:11)
       at Object.normalize (path.js:1179:5)
       at includes.filter.map.inclusion (D:\code\radio\src\sales\Drive.Sales.UI\node_modules\aurelia-cli\lib\build\bundle.js:95:45)
       at Array.map (native)
       at getDependencyLocations (D:\code\radio\src\sales\Drive.Sales.UI\node_modules\aurelia-cli\lib\build\bundle.js:94:8)
       at bundles.reduce (D:\code\radio\src\sales\Drive.Sales.UI\node_modules\aurelia-cli\lib\build\bundler.js:204:53)
       at Array.reduce (native)
       at getAllDependencyLocations (D:\code\radio\src\sales\Drive.Sales.UI\node_modules\aurelia-cli\lib\build\bundler.js:204:25)
       at getInclusion (D:\code\radio\src\sales\Drive.Sales.UI\node_modules\aurelia-cli\lib\build\bundled-source.js:157:44)
       at amodroTrace.then.traceResult (D:\code\radio\src\sales\Drive.Sales.UI\node_modules\aurelia-cli\lib\build\bundled-source.js:147:19),
  duration: [ 6, 53697754 ],
  time: 1491370564805 }
{ uid: 0,
  name: '<series>',
  branch: true,
  error:
   TypeError: Path must be a string. Received undefined
       at assertPath (path.js:7:11)
       at Object.normalize (path.js:1179:5)
       at includes.filter.map.inclusion (D:\code\radio\src\sales\Drive.Sales.UI\node_modules\aurelia-cli\lib\build\bundle.js:95:45)
       at Array.map (native)
       at getDependencyLocations (D:\code\radio\src\sales\Drive.Sales.UI\node_modules\aurelia-cli\lib\build\bundle.js:94:8)
       at bundles.reduce (D:\code\radio\src\sales\Drive.Sales.UI\node_modules\aurelia-cli\lib\build\bundler.js:204:53)
       at Array.reduce (native)
       at getAllDependencyLocations (D:\code\radio\src\sales\Drive.Sales.UI\node_modules\aurelia-cli\lib\build\bundler.js:204:25)
       at getInclusion (D:\code\radio\src\sales\Drive.Sales.UI\node_modules\aurelia-cli\lib\build\bundled-source.js:157:44)
       at amodroTrace.then.traceResult (D:\code\radio\src\sales\Drive.Sales.UI\node_modules\aurelia-cli\lib\build\bundled-source.js:147:19),
  duration: [ 22, 761216000 ],
  time: 1491370564821 }
TypeError: Path must be a string. Received undefined
    at assertPath (path.js:7:11)
    at Object.normalize (path.js:1179:5)
    at includes.filter.map.inclusion (D:\code\radio\src\sales\Drive.Sales.UI\node_modules\aurelia-cli\lib\build\bundle.js:95:45)
    at Array.map (native)
    at getDependencyLocations (D:\code\radio\src\sales\Drive.Sales.UI\node_modules\aurelia-cli\lib\build\bundle.js:94:8)
    at bundles.reduce (D:\code\radio\src\sales\Drive.Sales.UI\node_modules\aurelia-cli\lib\build\bundler.js:204:53)
    at Array.reduce (native)
    at getAllDependencyLocations (D:\code\radio\src\sales\Drive.Sales.UI\node_modules\aurelia-cli\lib\build\bundler.js:204:25)
    at getInclusion (D:\code\radio\src\sales\Drive.Sales.UI\node_modules\aurelia-cli\lib\build\bundled-source.js:157:44)
    at amodroTrace.then.traceResult (D:\code\radio\src\sales\Drive.Sales.UI\node_modules\aurelia-cli\lib\build\bundled-source.js:147:19)

Where am I going wrong here?

@JeroenVinke
Copy link
Collaborator

That is because the CLI does not support bundling files outside of of the node modules folder yet. #567 is similar. A PR that adds this support has been made

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

No branches or pull requests

2 participants