spatie / vue-table-component

A straight to the point Vue component to display tables

Home Page:http://vue-table-component.spatie.be

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't resolve './Tbody' error

robertjk opened this issue · comments

When using 2.0.0-alpha1 version (which is the version npm install vue-table-component installs by default) I get the following error:

./node_modules/vue-table-component/dist/components/TableComponent.js Module not found: Error: Can't resolve './Tbody' in '/home/robert/programming/n6/n6/N6Portal/gui/node_modules/vue-table-component/dist/components'
@ ./node_modules/vue-table-component/dist/components/TableComponent.js 3:0-28
@ ./node_modules/vue-table-component/dist/index.js
@ ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/SearchResultsDisplay.vue?vue&type=script&lang=js
@ ./src/components/SearchResultsDisplay.vue?vue&type=script&lang=js
@ ./src/components/SearchResultsDisplay.vue
@ ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/SearchPage.vue?vue&type=script&lang=js
@ ./src/components/SearchPage.vue?vue&type=script&lang=js
@ ./src/components/SearchPage.vue
@ ./src/router/index.js
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://0.0.0.0:8080 webpack/hot/dev-server ./src/main.js

For me the reason seems to be the typo on your side. In /dist/components/TableComponent.js you have the line import Tbody from './Tbody';, while the file is named TBody.js (capital B). The same mismatch occurs for Thead import. Contrary Tfoot.js file is really named with lower case f.

I suggest correcting the file names and sticking to one file names casing convention.

Seeing the same.

2.0.0-alpha isn't stable. Use v1. Does anyone know why npm does this and if it can be fixed?

@sebastiandedeyne It's about the wrong version being tagged as latest in npm registry (look here in Versions tab). I think this guide explains how to publish the correct version:

Adding tags

To add a tag to a specific version of your package, use:

npm dist-tag add <pkg>@<version> [<tag>]

Publishing with tags

By default, npm publish will tag your package with the latest tag. If you use the --tag flag, you can specify another tag to use. For example, the following will publish your package with the beta tag:

npm publish --tag beta

Anyone coming across this thread should also use npm i vue-table-component@1.9.1, JFYI.

We don't use this package anymore in our own projects and cannot justify the time needed to maintain it anymore. That's why we have chosen to abandon it. Feel free to fork our code and maintain your own copy or use one of the many alternatives.