heroiclabs / nakama-js

JavaScript client for Nakama server written in TypeScript.
https://heroiclabs.com/docs/nakama/client-libraries/javascript/
Apache License 2.0
190 stars 56 forks source link

Version 2.4.0 published on NPM registry missing nakama-js.cjs.js file #129

Closed maxbbb closed 2 years ago

maxbbb commented 2 years ago

After upgrading to 2.4.0 I started receiving an error that the nakama-js package could not be resolved because it was missing one of the build files.

error While trying to resolve module '@heroiclabs/nakama-js' from file, the package 
'node_modules/@heroiclabs/nakama-js/package.json' was successfully found. 
However, this package itself specifies a 'main' module field that could not be resolved 
('node_modules/@heroiclabs/nakama-js/dist/nakama-js.cjs.js').

Comparing the 2.3.0 package to the 2.4.0 package it does look like the file is missing, and adding the file from the repo fixed the issue. I assume this is just a publishing error.

MWFIAE commented 2 years ago

@novabyte Got the same issue 🙏

lugehorsam commented 2 years ago

Very odd guys. I ran npm pack which simulates npm publish but produces a local tarball and it does include the common js file. I hate not knowing root cause but I am just going to try publishing again.

lugehorsam commented 2 years ago

@MWFIAE @maxbbb it appears to be a bug or unexpected behavior with the yarn workspaces API. I republished a new client using the raw npm commands: https://www.npmjs.com/package/@heroiclabs/nakama-js

Let me know how it goes.

MWFIAE commented 2 years ago

The new package includes the file and everything compiles again for me 🥳

formatCvt commented 2 years ago

Hi guys, same issue with nakama-js-protobuf package

image

lugehorsam commented 2 years ago

hey @formatCvt I just published a new protobuf version. Could you try 1.2.1 instead?

formatCvt commented 2 years ago

everything is fine, thanks!