Coder Social home page Coder Social logo

Comments (2)

jackw avatar jackw commented on August 15, 2024

@mwiehler many thanks for reporting this issue. I can see from the error messages you're using Windows with PNPM. Is this correct?

Please note this project is setup for using NPM as the package manager. If you use NPM instead of PNPM you shouldn't have any of these issues.

However if you are keen to continue with PNPM I think I managed to reproduce the error you're having. The issue is due to the way PNPM hoists and symlinks packages. In this case it's specifically the @types packages which are causing the issue. To solve it we need to make use of the .npmrc file to tell PNPM what to hoist into the root node_modules directory. You can find further information about this in their docs here.

Please could you copy the following into a .npmrc file in the root of the plugin project (where the package.json file is).

# This file is required for PNPM

# PNPM 8 changed the default resolution mode to "lowest-direct" which is not how we expect resolutions to work
resolution-mode="highest"

# Make sure the default patterns are still included (https://pnpm.io/npmrc#public-hoist-pattern)
public-hoist-pattern[]="*eslint*"
public-hoist-pattern[]="*prettier*"

# Hoist all types packages to the root for better TS support
public-hoist-pattern[]="@types/*"

# @grafana/e2e expects cypress to exist in the root of the node_modules directory
public-hoist-pattern[]="*cypress*"

Once done run pnpm install again. If the previous .npmrc step was followed you should see a message like:

โœ” The modules directory at "/Users/bob/dev/sandbox/datasource-http-backend/node_modules" will be removed and reinstalled from scratch. Proceed? (Y/n) ยท true
Recreating /Users/bob/dev/sandbox/datasource-http-backend/node_modules

Make sure to select true and let pnpm do its thing. Once the install is complete try running pnpm run build again. It should now work. Happy plugin dev'ing! ๐Ÿš€

from grafana-plugin-examples.

mwiehler avatar mwiehler commented on August 15, 2024

Thank you so much! This worked!

from grafana-plugin-examples.

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.