Closed Benjamin-Dobell closed 8 years ago
It might be worth noting this is a new project that never built properly in the past either due to #898.
woah... that's bizarre. How are you building the bundle – are you doing rollup ... > output.js
? If so, could you try rollup ... -o output.js
instead? I wonder if Node itself is the culprit here, I believe it has some bugs relating to just this sort of garbled output
I'm typically building with rollup -c
.
I've just tried rollup -c -o output.js
, which to my surprise yields quite different output, which starts with:
import { writeFileSync } from 'fs';
import fs__default from 'fs';
import * as fs from 'fs';
import { inherits } from 'util';
import * as util from 'util';
import { Transform } from 'stream';
import path from 'path';
... which isn't valid node syntax (ES6 module syntax).
It would seem something very funky is going on, hopefully it's just my setup. It's just past midnight here and I think I'm too tired to draw any logical conclusions. I'll look into it further in the next 48 hours an report back.
Turns out this is a rollup-plugin-json issue:
I've just updated to 0.35.0 and I'm seeing mangled output:
I'm not sure what's going on.
Unfortunately I'm not even sure what this code is - presumably something auto-generated for the CJS bundle (it's not my code). However, it's not at all valid JS syntax.
What makes me think we've got some sort of output buffer race going on is the path in the above excerpt:
/sers/ben/Development/Snloader/snapoader-screnshot-tool
That's not a valid path, the correct path would be:
/Users/ben/Development/Snaploader/snaploader-screenshot-tool