vercel / pkg

Package your Node.js project into an executable
https://npmjs.com/pkg
MIT License
24.31k stars 1.01k forks source link

SyntaxError: Invalid or unexpected token #1971

Closed jaythakor-ai closed 9 months ago

jaythakor-ai commented 1 year ago

What version of pkg are you using?

5.8.1

What version of Node.js are you using?

18.9.0

What operating system are you using?

Ubuntu 22.04

What CPU architecture are you using?

x86_64

What Node versions, OSs and CPU architectures are you building for?

node18

Describe the Bug

When creating the package of some folders that contains the python files, package created successfully without any errors but it is giving error at application run time.

It's giving below error:

SyntaxError: Invalid or unexpected token at new Script (node:vm:102:7) at readPrelude (node:internal/bootstrap/pkg:29:13) at node:internal/bootstrap/pkg:36:18 at node:internal/bootstrap/pkg:43:4 at node:internal/bootstrap/pkg:44:2

Note: I am not sure that the error is because of the python files. But above error only occures when creating package of node application which contains the python files in some folder.

Expected Behavior

It should work perfectly as it is working for other format files.

To Reproduce

Create node app. Just put a folder with some python files. And then try to create package including that folder.

pravinba9495 commented 1 year ago

Same here.

pkg/prelude/bootstrap.js:1
Qc��:

SyntaxError: Invalid or unexpected token
    at new Script (node:vm:102:7)
    at readPrelude (node:internal/bootstrap/pkg:29:13)
    at node:internal/bootstrap/pkg:36:18
    at node:internal/bootstrap/pkg:43:4
    at node:internal/bootstrap/pkg:44:2
pchakour commented 1 year ago

Same for me !