Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nuxt Bridge without Nitro is not able to resolve TypeScript files #683

Closed
Physer opened this issue Jan 10, 2023 · 4 comments
Closed

Nuxt Bridge without Nitro is not able to resolve TypeScript files #683

Physer opened this issue Jan 10, 2023 · 4 comments

Comments

@Physer
Copy link

Physer commented Jan 10, 2023

Versions

  • nuxt: nuxt-edge (2.16) with nuxt-bridge
  • node: 16.x

Introduction

When using nuxt-edge with nuxt-bridge but without using nitro, the compiler is unable to resolve TypeScript files that get loaded into the Vue components.

Reproduction

A reproduction repository is available here: https://github.com/Physer/nuxt-bridge-disabled-modern-build-issue.
Including a detailed readme with version overview.

Additional Details
This repository shows an issue with the --modern flag for the Nuxt CLI.

When using Nuxt Bridge (nuxt-edge and nuxt-bridge) but Nitro is disabled as a build tool, the --modern flag is unable to resolve a Typescript import.

Steps to reproduce

  1. Install nuxt-edge and nuxt-bridge
  2. Keep your package.json's script configuration to keep using the nuxt CLI (not `nuxi)
  3. Add the --modern flag to the build command (i.e. nuxt build --modern=server
  4. Update the Nuxt config to be TypeScript compatible and add the defineNuxtConfig as according to the documentation
  5. Disable the nitro build system in your Nuxt config:
  bridge: {
    nitro: false,
  },
  1. Build your application by running the build with the modern flag

What is Expected?

It's expected to build the application properly without any errors and allowing modern browsers to use less JavaScript.

What is actually happening?

Actually the application is not able to built because it can't resolve a TypeScript file. Resulting in a compilation error.

@danielroe danielroe transferred this issue from nuxt/nuxt Jan 10, 2023
@aldarund
Copy link

Happens with nitro enabled too. To reproduce just enough to have modern: true

@aldarund
Copy link

Caused by this commit ddd8ecc

@manzoliric
Copy link

Any fix for this issue? I'm experiencing the same problem when using "--modern-server". Is it deprecated?

@Physer
Copy link
Author

Physer commented Dec 2, 2023

It's been quite a while since I've dealt with this issue but if I remembered correctly, the main problem here is that we tried using Nuxt Bridge without Nitro and the nuxi CLI.

The nuxi CLI does not have support for the modern flag and neither does Nuxt 3.

In the end this was a problem for us because we were in a sort of limbo state between Nuxt 2 and Nuxt 3, using Nuxt Bridge but not using Nitro.

In the end we migrated to Nitro and using the nuxi CLI, which didn't have the flag to begin with, making the issue moot.

@Physer Physer closed this as not planned Won't fix, can't repro, duplicate, stale Dec 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants