node-capnp icon indicating copy to clipboard operation
node-capnp copied to clipboard

Module.js throws error on trying to load the .capnp file

Open Pooja71 opened this issue 8 years ago • 1 comments

The following line

var foo = require("./foo.capnp");

throws an Exception/: unexpected Symbol as the first line is the schema ID 0x..... Am I calling the schema in a wrong way?

Environment Used node: 6.11.2

Pooja71 avatar Aug 31 '17 20:08 Pooja71

Hi Pooja,

Can you provide a more complete test case? Please show us the whole Javascript file and the whole .capnp file, and how you're invoking it on the command line.

It's hard to say what the problem could be without all the info, but here's one possibility: You have to call require("capnp") before you can require a .capnp file.

kentonv avatar Sep 05 '17 01:09 kentonv