Closed LukaszPiatkowski27 closed 5 days ago
I never heard of esbuild, but it seems it's an bundler like webpack etc. ?
I'm not sure if we can help with that issue.
@wenzhixin do you used it before ?
@LukaszPiatkowski27 i guess you already tried to find a solution on google or in the esbuild community ? The chance is high, that this is an issue of esbuild as other bundler works fine.
FWIW esbuild is at least used by vite, and other bundlers if I recall correctly.
That said, it looks like boostrap-table is missing a dependency on core-js. My copy of node_modules/bootstrap-table/dist/bootstrap-table.js
has many references to core-js and I don't see core-js in node_modules/bootstrap-table/package.json
. I too was getting "Could not resolve" errors when building with vite/esbuild and adding core-js to my package.json fixed the errors.
Similar issue with symfony asset:mapper, and another project with yarn.
No issue when locking at 1.22.6
@UtechtDustin Yes, It's a bundler, webpack alternative. I did search for a solution, but didn't find anything (ofc adding core-js manually works, but that's just not a solution in my case). You can see that the core-js dependency is missing for more people.
Oh okay, thanks for the informations!
I guess i found the issue, as we use babel-preset-env
which then uses polyfills using core-js
.
The Problem is i can't submit a PR for that, as the bootstrap-table currently uses yarn as dependency manager and i stopped using yarn 2 years ago and switched back to npm. As i don't see huge advantages to use yarn instead of npm right now. We just add a layer on top (also the installation and version management is quit shit - in my opinion - on the newest yarn version). @wenzhixin What is the reason, that we use yarn instead of npm ? Could we switch to npm ?
Any update on this? IMHO a separate issue should be opened to discuss package manager preferences and in the meantime the proper dependencies can be added using yarn.
@wenzhixin do you used it before?
I have not used esbuild
before, either.
However, I followed the following steps to test it:
Create a file main.js
import 'bootstrap-table'
I think you can solve your problem using the following method, and I will also investigate whether there is a better way.
You can add core-js
and jquery
in your package.json
to solve the problem.
npx esbuild src/main.js --bundle --sourcemap --outdir=builds
builds/main.js 548.8kb
builds/main.js.map 910.6kb
⚡ Done in 65ms
@wenzhixin We just have to add core-js as dependency to our package.json and the issue should be fixed. As i mentioned above i can't submit a PR as we still using yarn and not npm, is there a reason for that ?
My idea is to improve the build script without dependency on core-js.
Adding core-js
to devDependencies
can solve the problem, and the built files in dist
will not require core-js
at all.
Bootstraptable version(s) affected
1.23.0
Description
trying to run this command![image](https://github.com/wenzhixin/bootstrap-table/assets/56541552/a4427710-87b0-406b-a17b-ed78c1c0e8b8)
esbuild app/javascript/*.* --bundle --sourcemap --outdir=app/assets/builds --public-path=/assets
throws the following error:Using version 1.22.6 there is no issue
Example(s)
No response
Possible Solutions
No response
Additional Context
No response