Skip to content

Weird bug when using monorepo #2538

@floratmin

Description

@floratmin

Describe the bug

I am using a monorepo and have a problem importing components into my application. Up until solid-js v1.9.5 everything worked fine in my repository. But whenever I upgrade to a newer version I get the following error:

index.jsx:17 Error: <A> and 'use' router primitives can be only used inside a Route.

However when I created a minimal reproduction of the error, all of a sudden it started to work with solid-js v1.9.9 and the error shows when I use solid-js v1.9.5 and use pnpm page-direct-import dev.

But in my monorepo the direct import and exports import both work fine with v1.9.5 and both break with v1.9.9.

Your Example Website or App

https://github.com/floratmin/solid-monorepo-route-breaks

Steps to Reproduce the Bug or Issue

Minimal reproduction

  1. pnpm i
  2. pnpm page-direct-import dev
  3. Open page and click on about link
  4. The error gets displayed
  5. Change solid-js version to v1.9.9 in all package.json of apps packages
  6. pnpm i
  7. pnpm page-direct-import dev / pnpm page-exports-import dev / pnpm page
  8. Open page and click on about link
  9. Everything works

My monorepo (both direct import and exports import)

  1. Solid-js version is v1.9.5
  2. pnpm page dev
  3. everything works
  4. Change solid-js version to v1.9.9 in all package.json of apps packages
  5. pnpm i
  6. pnpm page dev
  7. Open page and click on about link
  8. The error gets displayed

Expected behavior

Routing should not loose context

Screenshots or Videos

No response

Platform

  • OS: [e.g. macOS, Windows, Linux] Ubuntu
  • Browser: [e.g. Chrome, Safari, Firefox] Chrome
  • Version: [e.g. 91.1]

Additional context

This issue seems related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions