Closed giuseppealbrizio closed 1 year ago
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
Would you be able to provide a minimal repro? I think I need to dig around and debug it, and I'm not familiar with setting up a new Vite/React project, so it might take some time to get that up and running, unless you can provide a minimal repro.
The thing is that the compiler is pointing to a place in the middle of the comment so I think the source map must be off by a few lines, because that is probably the correct file (it's recently added) but it's probably the actual code in the file that is the problem. If I can get my hands on a running project then I can probably mess around in the dist file and identify what line it's having a problem with.
Or if you want to try something yourself, you can go into node_modules/@firebase/util/dist/index.esm2017.js
, find that comment and delete it, and see if anything changes. (Perhaps there's a weird whitespace character or something? Maybe there's something about putting process.env in a comment?)
Would you be able to provide a minimal repro? I think I need to dig around and debug it, and I'm not familiar with setting up a new Vite/React project, so it might take some time to get that up and running, unless you can provide a minimal repro.
The thing is that the compiler is pointing to a place in the middle of the comment so I think the source map must be off by a few lines, because that is probably the correct file (it's recently added) but it's probably the actual code in the file that is the problem. If I can get my hands on a running project then I can probably mess around in the dist file and identify what line it's having a problem with.
Or if you want to try something yourself, you can go into
node_modules/@firebase/util/dist/index.esm2017.js
, find that comment and delete it, and see if anything changes. (Perhaps there's a weird whitespace character or something? Maybe there's something about putting process.env in a comment?)
Yes just checked in the node_modules/@firebase/util/dist/index.esm2017.js
and seems that the comment at line 642-646 creates some issue in the build process of Vite. It's something related with putting process.env in the comment. I'll open an issue into the Vite repo just to check with them this issue.
/**
* Attempt to read defaults from a JSON string provided to
* process.env.__FIREBASE_DEFAULTS__ or a
* process.env.__FIREBASE_DEFAULTS_PATH__
*/
Deleted this comment and the build command goes smooth.
Thank you
Oh thanks so much, I'll make a PR to reformat that comment in the meantime. It might take a while to get released since we are not planning on another release before the end of the year.
Possibly related: https://github.com/firebase/firebase-js-sdk/issues/6887
[REQUIRED] Describe your environment
[REQUIRED] Describe the problem
Starting from version 9.11.0 Vite build command fails. To avoid this issue need to rollup the firebase version to 9.10.0
Steps to reproduce:
Relevant Code:
console output
package.json
VITE config file