Open canadaduane opened 4 years ago
Yeah I haven't gotten around to it yet. Personally I don't run into this much because i've been using it for a long time and must know how to avoid it, but i understand people just picking HECS up are likely to stumble into this quite often.
I might be able to look at adding source maps in the next week or two, it's probably not too hard.
Do you have a snippet that reproduces an error like the one above?
Do you have a snippet that reproduces an error like the one above?
Sure, here's my latest dumb mistake :)
Inside a System
's update method:
const transform = entity.get(Transform);
transform.position.add(undefined)
These are the steps I took to create a reproduction:
hecs-plugin-core
package WorldTransformSystem
and insert a throw new Error('LOL')
into the update()
functionyarn build
in hecs-plugin-core
yarn start
in hecs-example
This is what I see in the console:
(we're expecting to see minified code which is useless to us)
I then:
hecs-plugin-core
webpack config to remove config.devtool = false
yarn build
in hecs-plugin-core
This is what I see
All is good!
I also don't think we need to add the files
change in this PR. By default, Npm deploys all files. If you run npm pack
you can see what gets published and both src
and dist
are included already.
Just for brevity, I also double checked the source-maps are a separate file so as not to increase the bundle size.
@canadaduane if this works for you, lets remove the files
change and then I can merge
Ok, I can confirm this works in hecs-example
. I'm unable to see sources in my own project, but I suspect this may be my own misconfiguration.
Occasionally I do something dumb (ok, quite often) and end up in some code path that HECS didn't anticipate, throwing an error that is hard to debug.
For example:
Adding source maps to the
dist/
folder would help here (maybe).