Giter VIP home page Giter VIP logo

Comments (14)

xaksis avatar xaksis commented on May 29, 2024

hey @DarkerMatter can you tell me how you're including the library in your project?

from vue-good-table.

 avatar commented on May 29, 2024
yarn add vue-good-table

in main.js:

import VueGoodTable from 'vue-good-table'
Vue.use(VueGoodTable)

from vue-good-table.

 avatar commented on May 29, 2024

I realised that I first installed the lib while the electron app was still running. So, to see if that made any difference (hot compile vs cold compile), I removed the lib and readded it with yarn add vue-good-table.

Now I'm getting the following error:

Uncaught SyntaxError: Unexpected token import
    at createScript (vm.js:53:10)
    at Object.runInThisContext (vm.js:95:10)
    at Module._compile (module.js:543:28)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at eval (eval at <anonymous> (http://localhost:9080/renderer.js:1428:1), <anonymous>:1:18)

Weird!

from vue-good-table.

 avatar commented on May 29, 2024

Okay, I fixed that last error by modifying my webpack configuration but the original problem still stands.

from vue-good-table.

xaksis avatar xaksis commented on May 29, 2024

I am unable to replicate this.
node_modules/vue-good-table/src/images/search_icon.png already exists when you use yarn to install the package. So i'm not sure what your fix is accomplishing?

mkdir node_modules/vue-good-table/src/images
cp node_modules/vue-good-table/dist/static/img/search_icon.6cf060d.png node_modules/vue-good-table/src/images/search_icon.png

from vue-good-table.

 avatar commented on May 29, 2024

The node_modules/vue-good-table/src/images directory is missing after I run yarn add vue-good-table:

$ ls -l node_modules/vue-good-table
ls: node_modules/vue-good-table: No such file or directory
$ yarn add vue-good-table
yarn add v0.27.5
warning package.json: No license field
warning [email protected]: No license field
[1/5] Resolving packages...
[2/5] Fetching packages...
[3/5] Linking dependencies...
[4/5] Building fresh packages...
[5/5] Cleaning modules...
success Saved lockfile.
success Saved 3 new dependencies.
├─ [email protected]
├─ [email protected]
└─ [email protected]
warning [email protected]: No license field
$ npm run lint:fix

> [email protected] lint:fix /Users/user/Projects/electron/myproject
> eslint --ext .js,.vue -f ./node_modules/eslint-friendly-formatter --fix src test

Done in 28.31s.
$ ls -l node_modules/vue-good-table/src/
total 8
drwxr-xr-x  3 jquigley  staff   96 18 Jul 07:25 components
-rw-r--r--  1 jquigley  staff  397  6 Jul 20:37 index.js
$

I'm new to node/npm/javascript so please forgive me if I'm missing something obvious.

Could the lint:fix step be doing something?

from vue-good-table.

 avatar commented on May 29, 2024

I disabled the lint:fix step but the directory is still missing:

$ yarn remove vue-good-table
yarn remove v0.27.5
warning package.json: No license field
[1/2] Removing module vue-good-table...
[2/2] Regenerating lockfile and installing missing dependencies...
warning [email protected]: No license field
success Uninstalled packages.
Done in 23.31s.
$ ls -l node_modules/vue-good-table/src/
ls: node_modules/vue-good-table/src/: No such file or directory
$ yarn add vue-good-table
yarn add v0.27.5
warning package.json: No license field
warning [email protected]: No license field
[1/5] Resolving packages...
[2/5] Fetching packages...
[3/5] Linking dependencies...
[4/5] Building fresh packages...
[5/5] Cleaning modules...
success Saved lockfile.
success Saved 3 new dependencies.
├─ [email protected]
├─ [email protected]
└─ [email protected]
warning [email protected]: No license field
Done in 28.55s.
$ ls -l node_modules/vue-good-table/src/
total 8
drwxr-xr-x  3 jquigley  staff   96 18 Jul 07:58 components
-rw-r--r--  1 jquigley  staff  397  6 Jul 20:37 index.js
$

from vue-good-table.

 avatar commented on May 29, 2024

Okay, I removed and installed again using npm and the directory is there:

$ ls -l node_modules/vue-good-table/src/images/
ls: node_modules/vue-good-table/src/images/: No such file or directory
$ npm i --save vue-good-table
npm WARN gentlyRm not removing /Users/user/Projects/electron/myproject/node_modules/.bin/uglifyjs as it wasn't installed by /Users/user/Projects/electron/myproject/node_modules/uglify-js
npm WARN gentlyRm not removing /Users/user/Projects/electron/myproject/node_modules/.bin/semver as it wasn't installed by /Users/user/Projects/electron/myproject/node_modules/semver
npm WARN gentlyRm not removing /Users/user/Projects/electron/myproject/node_modules/.bin/nopt as it wasn't installed by /Users/user/Projects/electron/myproject/node_modules/nopt
npm WARN gentlyRm not removing /Users/user/Projects/electron/myproject/node_modules/.bin/mkdirp as it wasn't installed by /Users/user/Projects/electron/myproject/node_modules/mkdirp
npm WARN gentlyRm not removing /Users/user/Projects/electron/myproject/node_modules/.bin/browserslist as it wasn't installed by /Users/user/Projects/electron/myproject/node_modules/browserslist
npm WARN [email protected] requires a peer of webpack@^1.0||^2.1.0-beta||^2.2.0-rc but none was installed.
npm WARN [email protected] No repository field.
npm WARN [email protected] No license field.

+ [email protected]
added 3 packages, removed 1349 packages and updated 1 package in 74.259s


   ╭─────────────────────────────────────╮
   │                                     │
   │   Update available 5.1.0 → 5.3.0    │
   │     Run npm i -g npm to update      │
   │                                     │
   ╰─────────────────────────────────────╯

$ ls -l node_modules/vue-good-table/src/images/
total 32
-rw-r--r--  1 jquigley  staff  15447  9 Jun 13:16 search_icon.png
$

So, npm works and yarn doesn't :-(

from vue-good-table.

xaksis avatar xaksis commented on May 29, 2024

ah it could be this?
yarnpkg/yarn#3169

from vue-good-table.

 avatar commented on May 29, 2024

It looks like it. I installed the latest yarn nightly too and it's still happening. The weird thing is that you mentioned earlier that you installed without issue using yarn. What version of yarn are you using?

from vue-good-table.

xaksis avatar xaksis commented on May 29, 2024

I've got v0.27.5 and it works fine for me... leading me to believe that it has to do something with your local yarn...
did you try clearing the cache like they suggested in that thread?

from vue-good-table.

 avatar commented on May 29, 2024

I blew away the whole yarn installation and cache and reinstalled it from Homebrew which gives me 0.27.5 too and it still didn't work.

After reading through the whole thread I saw .yarnclean mentioned. I have that file and there was a line in there for images which I commented out and it all works fine now. I have no idea where the file came from as it isn't in the electron-vue repo.

When I get time, I'll start a new electron-vue project and see if the build process generates the file.

So, @xaksis, I just want to finish by saying thanks very much for your help and this project.

from vue-good-table.

xaksis avatar xaksis commented on May 29, 2024

@DarkerMatter no problem! I'm glad you were able to resolve it!

from vue-good-table.

mekhami avatar mekhami commented on May 29, 2024

I'm having a similar issue at the moment. Everything installed and compiled correctly, but when the table renders, I get a 404 on /static/img/search_icon.6cf060d.png, which is a directory that is served up by my webserver. Is there a better way to include this image file so that it does not conflict with webserver static paths?

from vue-good-table.

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.