Skip to content

Error in client running on dev server with depending modules and ts packages - ambigious indirect export #19993

Description

@u-hafner

Environment

Nuxi 3.0.0 (but also with newer versions 3.2.3)
RootDir: C:/VMs/SharedFolder/BuildingAutomation/UIServerGitHub/github/testprog
Nuxt project info:


  • Operating System: Windows_NT
  • Node Version: v18.13.0
  • Nuxt Version: ^3.2.3
  • Nitro Version: -
  • Package Manager: npm@9.6.2
  • Builder: webpack
  • User Config: modules
  • Runtime Modules: @advs/testmodule@1.0.8
  • Build Modules: -

Reproduction

Reproduction repo:
https://github.com/u-hafner/nuxt-dev-bug-demo

Describe the bug

The bug only occurs when running in dev:
npm run dev

On browser client side there is an error:
image

This does not happen in production. In production it works. But it is very inconvenient to always build and run production to see if your newest development is working.

The problem arises if there is a base module providing base classes and enums which are used in other ts packages and in the nuxt module and sometimes in the final program.
The idea behind this is to have a base packages testtspackage that defines common interfaces, classes and enums that should be used in derived works up to the final application. But in test environment it does not work.

So dependencies look like this:
testprog -> testmodule

testmodule (nuxt module) -> testts2package (ts package)
testmodule -> testts3package (ts package)

testts2package -> testtspackage
testts3package -> testtspackage

The "testtspackage" defines the base classes, enums and interfaces which are used in the other ts packages.

Running dev in browser you see the ambigious indirect export class2 in the console. In my initial case it was an enum. It somehow confuses that the testts2package usages are not the same as the testts3package usages I assume.

I added the node_modules of the testpackages to the testprogram as they are hosted in a private repo on my side.

Additional context

No response

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions