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

Requiring capnp files not working. #122

Open
LiamKarlMitchell opened this issue May 11, 2019 · 1 comment
Open

Requiring capnp files not working. #122

LiamKarlMitchell opened this issue May 11, 2019 · 1 comment

Comments

@LiamKarlMitchell
Copy link

LiamKarlMitchell commented May 11, 2019

Wanting to make a custom compiler plugin for capnp with node v12.2.0 running on Windows 10.

Intent: I would be generating source output for js or typescript with extra features added in regarding the annotations that can be supplied in the capnp schema.

Looks like the loader for require capnp files is not working, any thoughts did I set something up wrong?

Used example from readme.

const capnp = require('capnp-ts');
const schema = require("./capnp/schema.capnp").CodeGeneratorRequest;
# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors
^

SyntaxError: Invalid or unexpected token
    at Module._compile (internal/modules/cjs/loader.js:703:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
    at Module.load (internal/modules/cjs/loader.js:628:32)
    at Function.Module._load (internal/modules/cjs/loader.js:555:12)
    at Module.require (internal/modules/cjs/loader.js:666:19)
    at require (internal/modules/cjs/helpers.js:16:16)
    at Object.<anonymous> (D:\Source\OperationSpatial\capnp-to-jsbuffer\index.js:11:16)
    at Module._compile (internal/modules/cjs/loader.js:756:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
    at Module.load (internal/modules/cjs/loader.js:628:32)

Looking at the address book example in packages dir it requires a .js file which must first be generated.

Needed to use this command as capnpc was not found.

capnp compile -o js addressbook.capnp
@LiamKarlMitchell
Copy link
Author

Possibly the readme is not quite right for the compile command.

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

No branches or pull requests

1 participant