Code Monkey home page Code Monkey logo

Comments (9)

carrotalan avatar carrotalan commented on May 21, 2024 4

This is still an issue. Getting unexpected token when including pouchdb-fauxton in my project.

Command ran is:
pkg app.js --targets node6.11.2-linux-x64

I have tried also with and without this in my package.json file:

"pkg": {
"scripts": "node_modules/pouchdb-fauxton/www/*.js",
"assets": "node_modules/pouchdb-fauxton/www/index.html"
}

Output is:

> Error! Unexpected token (14:0)
  /Volumes/Data/Users/work/git/kiosk-platform/kiosk-site-api/node_modules/pouchdb-fauxton/www/index.html

Only temporary relief is to "minify" the HTML file using something like this: https://www.willpeavy.com/minifier/

from pkg.

motin avatar motin commented on May 21, 2024 1

Had the same issue with pouchdb-fauxton:

> Error! Unexpected token (14:0)
  /Users/motin/Dev/Projects/sq/sq-project/tools/clerk-cli/node_modules/pouchdb-fauxton/www/index.html

However, since I am certain that I am not using pouchdb-fauxton (which is just an optional web frontend), a workaround is to remove the node_modules/pouchdb-fauxton folder before running pkg.

from pkg.

igorklopov avatar igorklopov commented on May 21, 2024

Hi! I failed to reproduce. Seems that you add scripts entry somewhere. Can you post full package.json? Or even better minimal example with all files to reproduce.

from pkg.

jbdemonte avatar jbdemonte commented on May 21, 2024

Same project as in the other issue: https://github.com/jbdemonte/Retro-Manager

from pkg.

igorklopov avatar igorklopov commented on May 21, 2024

Please upgrade to [email protected] and try again

from pkg.

dotarmin avatar dotarmin commented on May 21, 2024

I get same error as @carrotalan when including pouchdb-fauxton, any update on this or is there any work around?

Thanks!

/Armin

from pkg.

tomachinz avatar tomachinz commented on May 21, 2024

I see this while trying to use the library vue-golden-layout

> [email protected]
> Error! Unexpected token (1:0)
  /Users/tom/Github/vue-golden-layout/node_modules/golden-layout/src/css/goldenlayout-base.css

from pkg.

zhengxiaoyao0716 avatar zhengxiaoyao0716 commented on May 21, 2024

It seems that pkg try to resolved non-javascript files (like .css) as javascript files and caused this problem.
For me, this just happend if the entrypoint was package.json or the project path, when I use the .js file as entrypoint, everything works well (but with no assets bundled). I have two speculations for that:

  1. maybe the pkg ignored all the non-javascript files when we use .js file as entrypoint, but not ignored them when we used package.json. Third-packages has their own assets files, what we expected is just to copied those non-javascript files into bundled package.
  2. maybe pkg always ignored those non-js files, but when we use package.json or project path as entrypoint, pkg just try to bundle all the dependencies defined in the package.json, but when we used .js file, it would try to resolved the correctly dependencies that really used in the entrypoint files, so the third-package with non-js files has never be resolved.

from pkg.

wb670 avatar wb670 commented on May 21, 2024

I see this while trying to use the library pm2

> [email protected]
> Error! Unexpected token (3:0)
  /var/www/dotd/node_modules/pm2-deploy/deploy

from pkg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.