vadimdemedes / yoga-layout-prebuilt

Prebuilt yoga-layout package
MIT License
47 stars 28 forks source link

packaging app into executable throws error #5

Open vkefallinos opened 4 years ago

vkefallinos commented 4 years ago

I use zeit/pkg to package my cli-app into an executable. It gives two warnings while packaging:

    > Warning Cannot include file %1 into executable.
   The file must be distributed with executable as %2.
    node_modules/opn/xdg-open
    path-to-executable/xdg-open
    > Warning Failed to make bytecode node10-x64 for file /snapshot/gen-codes- 
    repo/node_modules/yoga-layout-prebuilt/yoga-layout/build/Release/nbind.js

and an error while running the executable:

  /snapshot/gen-codes-repo/node_modules/yoga-layout-prebuilt/yoga-            
  layout/build/Release/nbind.js:53
    throw ex;
    ^

   Error: Cannot find module '/snapshot/gen-codes-repo/packages/cli/build/commands/index.js'

Have you found a way to package a pastel/ink app into an executable?

ps. Thank you for your amazing work!!!

vadimdemedes commented 4 years ago

Unfortunately can't help you here, never needed to do this, so I haven't encountered/fixed it myself.

davidwlhlm commented 3 years ago

Hi @vkefallinos! Were you able to resolve the issue? I'm experiencing the same issue right now and unfortunately I haven't found any solution so far.

Edit: It turns out that the warning message regarding yoga-layout-prebuilt is really just a warning, there must be an issue with the JavaScript in the index.js file as indicated by the error. In my setup with TypeScript, I had used the ncc package (from the same vendor as pkg) to transpile and bundle my code. I removed ncc from the project and replaced it with TypeScript's tsc, and it just worked.

zhuhe25 commented 3 years ago

你把无法打包的文件从 node_modules 里复制出来,然后 copy 到 .exe 文件的同级目录下,并修改引用路径就 ok 了