Code Monkey home page Code Monkey logo

Comments (2)

Alexandre-Fernandez avatar Alexandre-Fernandez commented on May 18, 2024 3

Apparently the problem are not monorepos but PNPM.
I made a new reproduction here :
https://github.com/Alexandre-Fernandez/astro-i18next-issue-48

If you install with npm install it works, but if you install with pnpm install you get the module not defined error.

Workaround

Add this file to your root :

/.npmrc

public-hoist-pattern[]="*deepmerge*"
public-hoist-pattern[]="*proload*"
public-hoist-pattern[]="*locale-emoji*"

https://pnpm.io/npmrc#public-hoist-pattern

from astro-i18next.

millette avatar millette commented on May 18, 2024

While I haven't used the module yet, I'm a big fan of both astro and pnpm so I had a quick look at the source.

First thing I notice is these 2 imports:

cli/utils.ts:import { AstroI18nextConfig } from "types";
cli/generate.ts:import { AstroI18nextConfig } from "types";

Both should probably import from "./types" (or ./types.ts - I never know if the extension is required).

Other than that, I see these imports, all from dev deps. Probably should be regular deps:

cli/utils.ts:import { fdir, PathsOutput } from "fdir"; // dev dep
index.ts:import { AstroIntegration } from "astro"; // dev dep
cli/middlewares.ts:import { MiddlewareFunction } from "yargs"; // dev dep
cli/index.ts:import yargs from "yargs"; // dev dep
cli/index.ts:import { hideBin } from "yargs/helpers"; // dev dep
cli/utils.ts:import fsExtra from "fs-extra"; // dev dep
cli/utils.ts:import ts from "typescript"; // dev dep

With those fixes, pnpm might be happy without resorting to public-hoist-patterns.

from astro-i18next.

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.