question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Option to specify path for Photon & Nexus output files

See original GitHub issue

As of right now, when looking for a place to put the generated code, Photon & Nexus apparently either find or create a node_modules folder, and then place the code in the @generated sub-directory of it. This works fine on a simple test project, but I’m running into an issue where I have a mono-repo setup with multiple projects in it:

  1. If I structure the project such that the generated code is placed in the node_modules folder at the root of the project, then I’ll suddenly have potential conflicts between different Photon/Nexus projects all overwriting the same locations.
  2. If I structure the project such that Photon/Nexus essentially create a new node_modules folder for each project, I’m now apparently unable to actually import the client, as the import Photon from "@generated/photon" found in the tutorial only seems to work for the root node_modules folder, and I get various “cannot find module” errors if I try to import the various clients directly, like via foo/node_modules/@generated/photon.

What’s the best way to go about handling multiple Photon/Nexus projects in a single repo?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
timsuchanekcommented, Jul 30, 2019

@artemzakharov ./ is needed, as this is a Node.js convention. Paths without a ./ or / are resolved as a node module.

As of now we don’t have the option to provide the path to the schema file, but feel free to create an issue!

1reaction
pantharshit00commented, Jul 30, 2019

If the output is outside of your node_modules folder, you will need to specify a relative path unless you have defined a babel or webpack plugin or configured your tsconfig to resolve that.

Try this:

import Photon from './prisma/generated/photon';
Read more comments on GitHub >

github_iconTop Results From Across the Web

Cisco Nexus 9000 Series NX-OS Fundamentals Configuration ...
The syntax for specifying a local file system is filesystem :[// modules /] . ... The initial default directory is bootflash. sup-standby.
Read more >
How to Determine the Location of the Nexus 3 Data Directory
Determine Your Nexus 3 Data Directory From Install Files. Go to the install directory of Nexus created using the Nexus Installer program.
Read more >
How to push nuget package in GitHub actions - Stack Overflow
I did not get the file name in the env var. I solved it by adding the command directly dotnet nuget push /path/$(ls...
Read more >
Managing Security Context Constraints | Cluster Administration
To view which SCCs will be changed you may run the command with no options or by specifying your preferred output with the...
Read more >
Nexus Operator 0.6.0-CR1 Install · GitHub
Directories within the path are not affected by this setting. ... description: Specifies the output format of the exposed resources, defaults to "1"....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found