Comments (6)
Well, I actually answered it myself when writing the issue I guess, and could resolve it by getting rid of the white space in my local path in Own Projects
-> own_projects
. As it may still be an issue users could ran into, and you might want to fix it, I leave it open but feel free to just close it otherwise.
from isolate-package.
Given I already shared all the code above, I will still add the following issue I'm facing in this thread; in case you have a helpful input that would be much appreciated!
The isolate
output is not as expected but for when I deploy the functions
folder, my setup seems to result in the common package to be looked for in node_modules
instead of ./packages/common
:
[2023-10-21T18:51:33.785Z] > [functions] package.json contents: {
"name": "functions",
"version": "0.0.0",
"scripts": {
"build": "tsc -b tsconfig.build.json",
"build:watch": "tsc --watch",
"serve": "npm run build && firebase emulators:start --only functions",
"shell": "npm run build && firebase functions:shell",
"start": "npm run shell",
"deploy": "firebase deploy --only functions",
"logs": "firebase functions:log"
},
"engines": {
"node": "18"
},
"main": "lib/index.js",
"dependencies": {
"common": "file:./packages/common",
"firebase-admin": "^11.8.0",
"firebase-functions": "^4.3.1"
},
"private": true
}
[2023-10-21T18:51:33.785Z] Building nodejs source
i functions: Loading and analyzing source code for codebase default to determine what to deploy
[2023-10-21T18:51:33.786Z] Could not find functions.yaml. Must use http discovery
[2023-10-21T18:51:33.798Z] Found firebase-functions binary at '/Users/<user>/Local/Dev/own_projects/<project>/node_modules/.bin/firebase-functions'
Serving at port 8243
[2023-10-21T18:51:34.086Z] Got response code 400; body Failed to generate manifest from function source: Error: Cannot find module '/Users/<user>/Local/Dev/own_projects/<project>/node_modules/common/dist'
shutdown requested via /__/quitquitquit
from isolate-package.
Hi Alexei,
Thanks for bringing the spaces in paths issue to my attention. That is an oversight. I think programmers traditionally avoid spaces exactly for this reason but modern software should of course just handle them correctly.
As for your remaining issue. I'm not sure what you mean with
my setup seems to result in the common package to be looked for in node_modules instead of ./packages/common:
The package json you posted is from the isolate output, right? The path there correctly points to "file:./packages/common", so I'm not sure what part of your setup you are referring to.
One thing I can think of is that your build script from package.json interferes with the deploy process.
At first I omitted the scripts, but then got a request to include them, which I did in v1.3.2. But then recently a user told me that the build script is being picked up by the firebase deploy pipeline, which it shouldn't really.
So I think in the next version I am going to at least create a configuration option to include/exclude the package scripts from the isolate output manifest.
Could you try to use v1.3.1, which still omits the scripts property? If that works then we know where the problem is...
from isolate-package.
Also, I wonder why you have these configurations set:
"workspaceRoot": "../..",
"workspacePackages": ["packages/*", "apps/*"],
If you are using a typical monorepo setup, I think they should not be required.
from isolate-package.
@alexeigs I've created an example that might find useful https://github.com/0x80/mono-ts
from isolate-package.
@alexeigs The spaces problem has been fixed in the latest version
Also, more importantly, isolated lockfiles are not generated for NPM and all other package managers.
from isolate-package.
Related Issues (20)
- Isolate seem to be not copying the `.env` file HOT 2
- Remove excess packages from the list in pnpm lockfile
- Fix package registry logic for non-rush repositories
- Strip forceNpm option for sake of simplicity
- Reintroduce excludeLockfile
- Add support for pnpm v9 HOT 4
- trouble shooting some problems HOT 3
- Consistently use pnpm pack if suitable
- Adopt packageManager field from root manifest
- Add flag to omit packageManager field
- Define config using a typed function
- Option to prevent move of node_modules for NPM HOT 3
- Will fail if pnpm-workspace.yaml is empty HOT 2
- Handle non-monorepo setups
- Isolated pnpm lockfile is missing overrides HOT 4
- Having some problems isolating a package HOT 5
- Improve support for Windows
- Isolate fails due to missing pnpm HOT 5
- Isolate fails due to missing pnpm on Windows
- Detect for all packages if they have a files field in manifest
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from isolate-package.