Giter Site home page Giter Site logo

Comments (6)

alexeigs avatar alexeigs commented on July 17, 2024

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.

alexeigs avatar alexeigs commented on July 17, 2024

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.

0x80 avatar 0x80 commented on July 17, 2024

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.

0x80 avatar 0x80 commented on July 17, 2024

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.

0x80 avatar 0x80 commented on July 17, 2024

@alexeigs I've created an example that might find useful https://github.com/0x80/mono-ts

from isolate-package.

0x80 avatar 0x80 commented on July 17, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.