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

TypeError: Cannot read property 'byteLength' of undefined #336

Closed
brielov opened this issue Apr 1, 2019 · 1 comment · Fixed by #337
Closed

TypeError: Cannot read property 'byteLength' of undefined #336

brielov opened this issue Apr 1, 2019 · 1 comment · Fixed by #337

Comments

@brielov
Copy link

brielov commented Apr 1, 2019

I'm trying ncc for the first time with a simple express server and when I use --v8-cache this error pops up.

ncc build -m --v8-cache index.js
TypeError: Cannot read property 'byteLength' of undefined
at renderSummary (evalmachine.:1:28261)
at handler (evalmachine.:1:31623)

// index.js

import http from 'http';
import express from 'express';
import morgan from 'morgan';
import helmet from 'helmet';
import cors from 'cors';
import bodyParser from 'body-parser';
import { version } from './package';

const app = express();

app.use(morgan('combined'));
app.use(helmet());
app.use(cors());
app.use(bodyParser.json());

app.get('/', (req, res) => res.json({ version }));

const server = http.createServer(app);

server.listen(() =>
  console.log(`server listening on http://127.0.0.1:${server.address().port}`),
);

I'm running macOS Mojave on a 13" macbook pro

@guybedford
Copy link
Contributor

Thanks so much for reporting, I can confirm this is a bug, and the fix is included in #337.

styfle pushed a commit that referenced this issue Apr 1, 2019
This fixes #336.

There was a regression on the v8-cache when asset permissions handling was added. This should have been caught by the self-build, but the self-build was effectively working around the API difference.

Fixes the self-build too and includes and end-to-end test of the v8-cache.
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

Successfully merging a pull request may close this issue.

2 participants