DataTables / DataTables/Vue

Typescript error

Open
#3 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Vue
Stars
78
Forks
16
PR merge metrics
No merged PRs in 30d

Description

Hello,

Using the example https://stackblitz.com/edit/datatables-net-vue3-bootstrap5?file=src%2FApp.vue works fine while i am running "npm run dev" but when i run "npm run build" i get this error:

src/components/dashboard/Users.vue:6:26 - error TS2306: File '/var/www/html/public-dev/node_modules/datatables.net-bs5/types/dataTables.bootstrap5.d.ts' is not a module.

6 import DataTableBs5 from 'datatables.net-bs5';
                           ~~~~~~~~~~~~~~~~~~~~
Found 1 error in src/components/dashboard/Users.vue:6

I am using vitejs, vuejs 3 and typescript. The "types/dataTables.bootstrap5.d.ts" file is empty

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the import in src/components/dashboard/Users.vue and inspect the empty node_modules/datatables.net-bs5/types/dataTables.bootstrap5.d.ts file. Reproduce the issue with npm run build and determine what change is needed so the TypeScript build accepts the DataTables import without the TS2306 error.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vite
Domain
build-system, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.