gl-matrix: Please revert version to 3.3.0 as 3.4.0 breaks things

Hi! please help revert version to 3.3.0 or bump version to 4.0.0 as many modules depending on gl-matrix is using ‘^’. 3.4.0 results build errors. Great appreciated!

image

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 21
  • Comments: 36 (11 by maintainers)

Most upvoted comments

Yup. This must be resolved as a lot of packages are dependent on that. Mostly react-map-gl, deck.gl, nebula.gl etc.

But for the quick and temp fix, yarn resolutions can help by adding following in the package.json file.

"resolutions": {
   "gl-matrix": "3.3.0",
}

Thanks for checking on that, @bilalajanjua. I’ve just published v3.4.1, which rolls in a few new fixes but avoids the backwards compat breaking change and should resolve the issue with the deprecated package taking priority. Please give it a try and let me know if you run into any additional problems!

No problem Brandon.

I tried with the version 3.4.1, but while building the react app with @math.gl as a dependency. I still get the same error i was getting with 3.4.0.

image

@math.gl is importing the vec2 module as follows, but I guess we can’t import it like this in v3.4.1:

import * as vec2 from 'gl-matrix/vec2';

Instead, it has to be imported like this as per new version:

import { vec2 } from 'gl-matrix';

So i guess, version 3.4.1 still doesn’t fix the problem.

Came here to post the same, can confirm it works until an official fix

Yup. This must be resolved as a lot of packages are dependent on that. Mostly react-map-gl, deck.gl, nebula.gl etc.

But for the quick and temp fix, yarn resolutions can help by adding following in the package.json file.

"resolutions": {
   "gl-matrix": "3.3.0",
}

Hallelujah! Thank you for taking the time to help me set that right, it’s been invaluable.

And now that I know what went wrong I can push out fixes more confidently in the future. Again, though, it may be best if I leave any big changes to a potential 4.0.0 just to avoid this whole song and dance.

Is there any solution I can use without using yarn?

Yup. This must be resolved as a lot of packages are dependent on that. Mostly react-map-gl, deck.gl, nebula.gl etc.

But for the quick and temp fix, yarn resolutions can help by adding following in the package.json file.

"resolutions": {
   "gl-matrix": "3.3.0",
}

Hi,

Yeah. There is another package which might help you with resolutions. I haven’t tried it though, so can’t guarantee.

https://www.npmjs.com/package/npm-force-resolutions

Thanks guys @toji @stefnotch @donmccurdy 🚀

I can confirm v3.4.3 works perfectly fine just like 3.3.0

P.S. These last few comments gave me an idea on how to publish a package without that dist folder. So yeah thanks for that. 😄

I’ll unpublish 3.4.0 for now. It looks like the top-of-tree has made changes (see https://github.com/toji/gl-matrix/pull/432#issuecomment-853225900) that simply aren’t going to be backwards compatible with every build system so I’ll need to do a major version bump if we’re going to publish any new updates. Might not be a bad time to see if there’s any other cleanups that need to be done while I’m at it.

Oh dearie, I’m very sorry for not properly documenting everything. If I recall correctly, I was publishing the package by doing

npm install
cd dist
npm publish

I’m not entirely sure why I had to cd into the dist directory for everything to work.

It’s also quite possible that one of the build system changes that I merged in was backwards incompatible.

Well crap. Turns out that the previous npm packages were being published FROM the dist folder, whereas I was publishing from the root.

…sigh

v3.4.3 has been published now (sure, let’s just burn through ALL the 3.4.x’s why don’t we.) Let’s give that a try.

(I apologize that this has been so much back and forth. I include gl-matrix in my own projects as a ES module and so the depenencies work out differently.)

@bilalajanjua thx man, you’re my saviour. 😃

Is there any solution I can use without using yarn?

Yup. This must be resolved as a lot of packages are dependent on that. Mostly react-map-gl, deck.gl, nebula.gl etc.

But for the quick and temp fix, yarn resolutions can help by adding following in the package.json file.

"resolutions": {
   "gl-matrix": "3.3.0",
}

Oh, I may have misunderstood something fairly fundamental about how @stefnotch was previously publishing the package. Let me verify something…

Ugh, thanks for checking.

One last thing, if you don’t mind (thank you so much for your help so far!) Can you try git://github.com/toji/gl-matrix.git#93d9f756d7bdc32d163f36d0b8cad74a6a795a98? That’s the same commit as v3.3.0 was built from with just a straight up rebuild. I’d like to know if that works, because if not it means I’m not able to rebuild a compatible release. Which… would not be great.

Sure @toji, On it.

Can confirm that 3.4.1 did not solve the issue for me either.

image

image

NPM won’t let me unpublish 3.4.0 since apparently there’s already some dependencies on it 😮 so I’ve marked it as deprecated instead. It’s not clear to me that will resolve the issue with people who have a dependency on ^3.3.0, though, so I’m looking into publishing a new version using an older commit in the repo before the backward compat breaking changes were introduced.

If anyone happens to be able to confirm that the deprecation DID fix the problem for you, though, I’d appreciate hearing it!