Giter Site home page Giter Site logo

Comments (6)

matthewmueller avatar matthewmueller commented on May 5, 2024

interesting, can you try running it again, this time with:

DEBUG=koa-bundle* node index.js

from bundle.

niftylettuce avatar niftylettuce commented on May 5, 2024
> [email protected] start /Users/nexus/Public/standard-signature
> node lib/

  koa-router defined route  /app(.*) +0ms
  koa-router defined route HEAD,GET /app/ +3ms
  koa-redis Init redis new client +6ms
  koa:application use - +14ms
  koa:application use logger +1ms
  koa:application use - +5ms
  koa-better-static static "/Users/nexus/Public/standard-signature/static-assets" {"maxage":86400000} +1ms
  koa:application use serve +0ms
'TypeError: Path must be a string. Received undefined\n    at assertPath (path.js:8:11)\n    at posix.join (path.js:479:5)\n    at fullpath (/Users/nexus/Public/standard-signature/node_modules/koa-bundle/index.js:429:30)\n    at entry (/Users/nexus/Public/standard-signature/node_modules/koa-bundle/index.js:120:12)\n    at _bundle (/Users/nexus/Public/standard-signature/node_modules/koa-bundle/index.js:88:19)\n    at Object.<anonymous> (/Users/nexus/Public/standard-signature/src/index.js:196:9)\n    at Module._compile (module.js:398:26)\n    at Object.Module._extensions..js (module.js:405:10)\n    at Module.load (module.js:344:32)\n    at Function.Module._load (module.js:301:12)\n    at Function.Module.runMain (module.js:430:10)\n    at startup (node.js:141:18)\n    at node.js:980:3'

from bundle.

niftylettuce avatar niftylettuce commented on May 5, 2024

It gets an error before any debugging occurs; I've reproduced this bug.

from bundle.

niftylettuce avatar niftylettuce commented on May 5, 2024

It's saying that the root is undefined

from bundle.

niftylettuce avatar niftylettuce commented on May 5, 2024

Okay I'll submit a documentation update, You just have to specify a root property in your options along with stuff like debug: true

from bundle.

niftylettuce avatar niftylettuce commented on May 5, 2024

Here's how I get scripts to get dynamically loaded:

let bundle = new Bundle({
  debug: true,
  root: __dirname
}, function(file, fn) {
  Browserify({ debug: file.debug })
    .add(file.path)
    .transform(babelify)
    .bundle(fn);
});

// this is a middleware that makes your scripts
// dir get served up as browserified/babelified
app.use(async function(ctx, next) {

  if (ctx.path.indexOf('/scripts/') !== 0)
    return next();

  let ext = path.extname(path.basename(ctx.path));
  if (ext !== '.js')
    return next();

  try {
    await convert(bundle(ctx.path))(ctx, next);
  } catch (err) {
    ctx.throw(404);
  }

});

from bundle.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.