admin管理员组文章数量:1122846
New to using laravel and vite.
Just trying to include DataTables in it.
So I created a new laravel project.
I added this to package.json
"jquery": "^3.7.1",
"datatables": "^2.0.8",
I added this to app.js
import jQuery from "jquery";
import $ from "jquery";
import DataTable from 'datatables';
window.DataTable = DataTable;
I add this to app.css
@import 'datatables';
Then I
- npm install
- opened a terminal and started Vite
- opened another terminal and started Laravel
- went to localhost:8000
and receive this error
[plugin:vite:css] [postcss] postcss-import:
C:\Dev\repos\warp9time_website\node_modules\datatables\js\dataTables.js:23:1: Unclosed bracket
C:\Dev\repos\warp9time_website\node_modules\datatables\js\dataTables.js:23:0
21 | */
22 |
23 | (function( factory ) {
| ^
24 | "use strict";
25 |
at Input.error (C:\Dev\repos\warp9time_website\node_modules\postcss\lib\input.js:106:16)
at Parser.unclosedBracket (C:\Dev\repos\warp9time_website\node_modules\postcss\lib\parser.js:577:22)
at Parser.other (C:\Dev\repos\warp9time_website\node_modules\postcss\lib\parser.js:423:35)
at Parser.parse (C:\Dev\repos\warp9time_website\node_modules\postcss\lib\parser.js:470:16)
at parse (C:\Dev\repos\warp9time_website\node_modules\postcss\lib\parse.js:11:12)
at get root [as root] (C:\Dev\repos\warp9time_website\node_modules\postcss\lib\no-work-result.js:119:14)
at Result.get [as root] (C:\Dev\repos\warp9time_website\node_modules\postcss\lib\no-work-result.js:27:21)
at loadImportContent (file:///C:/Dev/repos/warp9time_website/node_modules/vite/dist/node/chunks/dep-C6EFp3uH.js:867:33)
at async Promise.all (index 0)
at async resolveImportId (file:///C:/Dev/repos/warp9time_website/node_modules/vite/dist/node/chunks/dep-C6EFp3uH.js:800:27
A side note I have tried the various solutions in the post and they didn't work either.
How to use DataTables with Laravel Vite?
本文标签: Laravel Postcss Vite Datatablesnet 0 unenclosed bracket errorStack Overflow
版权声明:本文标题:Laravel Postcss Vite Datatables.net 0 unenclosed bracket error - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736303418a1931879.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论