Skip to content
This repository was archived by the owner on Mar 18, 2025. It is now read-only.
This repository was archived by the owner on Mar 18, 2025. It is now read-only.

Bundling Exceeds 100kb Limit #121

@christiannwamba

Description

@christiannwamba

Running wt commands works as expected. At this point of my example, I decide to split the files into different modules for maintainability. For this to happen, I will need to use webtask-bundle.

Unfortunately, when webask-bundle tries to do its thing, it creates a large bundle which exceeds the 100kb limit. The following error is thrown:

Uncaught error:  Request body size exceeds 122880
Error: Payload Too Large
    at Request.callback (/usr/local/lib/node_modules/wt-cli/node_modules/superagent/lib
/node/index.js:698:17)
    at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/wt-cli/node_modules/sup
eragent/lib/node/index.js:922:12)
    at emitNone (events.js:91:20)
    at IncomingMessage.emit (events.js:185:7)
    at endReadableNT (_stream_readable.js:974:12)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)

The weird thing is, the demo just have about 40 lines of codes though it imports express, body-parser, mongoose and webtask-tools.

Excerpt:

var Express = require('express');
var Webtask = require('webtask-tools');
var app = Express();
var mongoose = require('mongoose');

app.use(require('body-parser').json());

app.get('/id', function (req, res) {
    console.log(req.webtaskContext.secrets.MONGO_URL)
    res.json();
});

console.log(require('./routes/allStories')(app));
require('./routes/allStories')(app);

module.exports = Webtask.fromExpress(app);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions