I am upgrading my Rails application from bootstrap 4.6 to 5.0. In order to also upgrade DataTables, I performed:
yarn remove "datatables.net-bs4";
yarn remove "datatables.net-responsive-bs4";
yarn remove "datatables.net-select-dt";
then performed
yarn add datatables.net-bs5
yarn add datatables.net-responsive-bs5
yarn add datatables.net-select-bs5
I also updated my application.js to import the new libraries. When precompiling my JS code, I get the following error
[webpack-cli] ModuleNotFoundError: Module not found: Error: Can't resolve 'datatables.net-responsive' in '/Users/hashimgari/Codebases/heritage-calendarize/node_modules/datatables.net-responsive-bs5/js'
at /Users/hashimgari/Codebases/heritage-calendarize/node_modules/webpack/lib/Compilation.js:925:10
at /Users/hashimgari/Codebases/heritage-calendarize/node_modules/webpack/lib/NormalModuleFactory.js:401:22
at /Users/hashimgari/Codebases/heritage-calendarize/node_modules/webpack/lib/NormalModuleFactory.js:130:21
at /Users/hashimgari/Codebases/heritage-calendarize/node_modules/webpack/lib/NormalModuleFactory.js:224:22
at /Users/hashimgari/Codebases/heritage-calendarize/node_modules/neo-async/async.js:2830:7
at /Users/hashimgari/Codebases/heritage-calendarize/node_modules/neo-async/async.js:6877:13
at /Users/hashimgari/Codebases/heritage-calendarize/node_modules/webpack/lib/NormalModuleFactory.js:214:25
at /Users/hashimgari/Codebases/heritage-calendarize/node_modules/enhanced-resolve/lib/Resolver.js:213:14
at /Users/hashimgari/Codebases/heritage-calendarize/node_modules/enhanced-resolve/lib/Resolver.js:285:5
at eval (eval at create (/Users/hashimgari/Codebases/heritage-calendarize/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:15:1)
at /Users/hashimgari/Codebases/heritage-calendarize/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js:44:7
at /Users/hashimgari/Codebases/heritage-calendarize/node_modules/enhanced-resolve/lib/Resolver.js:285:5
at eval (eval at create (/Users/hashimgari/Codebases/heritage-calendarize/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:15:1)
at /Users/hashimgari/Codebases/heritage-calendarize/node_modules/enhanced-resolve/lib/Resolver.js:285:5
at eval (eval at create (/Users/hashimgari/Codebases/heritage-calendarize/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:27:1)
at /Users/hashimgari/Codebases/heritage-calendarize/node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js:67:43
resolve 'datatables.net-responsive' in '/Users/hashimgari/Codebases/heritage-calendarize/node_modules/datatables.net-responsive-bs5/js'
Parsed request is a module
using description file: /Users/hashimgari/Codebases/heritage-calendarize/node_modules/datatables.net-responsive-bs5/package.json (relative path: ./js)
Field 'browser' doesn't contain a valid alias configuration
resolve as module
looking for modules in /Users/hashimgari/Codebases/heritage-calendarize/app/javascript
using description file: /Users/hashimgari/Codebases/heritage-calendarize/package.json (relative path: ./app/javascript)
Field 'browser' doesn't contain a valid alias configuration
using description file: /Users/hashimgari/Codebases/heritage-calendarize/package.json (relative path: ./app/javascript/datatables.net-responsive)
no extension
Field 'browser' doesn't contain a valid alias configuration
/Users/hashimgari/Codebases/heritage-calendarize/app/javascript/datatables.net-responsive doesn't exist
.mjs
Field 'browser' doesn't contain a valid alias configuration
/Users/hashimgari/Codebases/heritage-calendarize/app/javascript/datatables.net-responsive.mjs doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
/Users/hashimgari/Codebases/heritage-calendarize/app/javascript/datatables.net-responsive.js doesn't exist
.sass
Field 'browser' doesn't contain a valid alias configuration
/Users/hashimgari/Codebases/heritage-calendarize/app/javascript/datatables.net-responsive.sass doesn't exist
.scss
Field 'browser' doesn't contain a valid alias configuration
/Users/hashimgari/Codebases/heritage-calendarize/app/javascript/datatables.net-responsive.scss doesn't exist
.css
Field 'browser' doesn't contain a valid alias configuration
/Users/hashimgari/Codebases/heritage-calendarize/app/javascript/datatables.net-responsive.css doesn't exist
.module.sass
Field 'browser' doesn't contain a valid alias configuration
/Users/hashimgari/Codebases/heritage-calendarize/app/javascript/datatables.net-responsive.module.sass doesn't exist
.module.scss
Field 'browser' doesn't contain a valid alias configuration
/Users/hashimgari/Codebases/heritage-calendarize/app/javascript/datatables.net-responsive.module.scss doesn't exist
.module.css
Field 'browser' doesn't contain a valid alias configuration
/Users/hashimgari/Codebases/heritage-calendarize/app/javascript/datatables.net-responsive.module.css doesn't exist
.png
Field 'browser' doesn't contain a valid alias configuration
/Users/hashimgari/Codebases/heritage-calendarize/app/javascript/datatables.net-responsive.png doesn't exist
.svg
Field 'browser' doesn't contain a valid alias configuration
/Users/hashimgari/Codebases/heritage-calendarize/app/javascript/datatables.net-responsive.svg doesn't exist
.gif
Field 'browser' doesn't contain a valid alias configuration
/Users/hashimgari/Codebases/heritage-calendarize/app/javascript/datatables.net-responsive.gif doesn't exist
.jpeg
Field 'browser' doesn't contain a valid alias configuration
/Users/hashimgari/Codebases/heritage-calendarize/app/javascript/datatables.net-responsive.jpeg doesn't exist
.jpg
Field 'browser' doesn't contain a valid alias configuration
/Users/hashimgari/Codebases/heritage-calendarize/app/javascript/datatables.net-responsive.jpg doesn't exist
as directory
/Users/hashimgari/Codebases/heritage-calendarize/app/javascript/datatables.net-responsive doesn't exist
and within the browser console I receive
responsive.bootstrap5.js:9 Uncaught Error: Cannot find module 'datatables.net-responsive'
at webpackMissingModule (responsive.bootstrap5.js:9)
at responsive.bootstrap5.js:9
at Object../node_modules/datatables.net-responsive-bs5/js/responsive.bootstrap5.js (responsive.bootstrap5.js:33)
at __webpack_require__ (bootstrap:19)
at Module.<anonymous> (application.js:1)
at Module../app/javascript/packs/application.js (application.js:65)
at __webpack_require__ (bootstrap:19)
at bootstrap:83
at bootstrap:83
The download builder does not mention needing the base datatables.net-responsive
but when added the errors go away but my tables don't seem to be formatted as they were with bs-4.