Skip to content

Latest version pulls in server dependencies in client modules #116

@JanStevens

Description

@JanStevens

Package version

8.1.0

Describe the bug

Hi,

After upgrading to latest version I noticed that I ended up with a blank page cause by the frontend error. Using inertia and tuyau.

TypeError: (0 , import_node_module.createRequire) is not a function
    at chunk-B2GA45YG.js:33:33

Tracing it back it seems that the build artifacts pull in the server chunk causing the issues (see https://www.npmjs.com/package/@adonisjs/http-server?activeTab=code and navigate to build/src/client/url_builder.js).

When patching the dependency to remove the line everything works again

diff --git a/node_modules/@adonisjs/http-server/build/src/client/url_builder.js b/node_modules/@adonisjs/http-server/build/src/client/url_builder.js
index 38d91e0..37da766 100644
--- a/node_modules/@adonisjs/http-server/build/src/client/url_builder.js
+++ b/node_modules/@adonisjs/http-server/build/src/client/url_builder.js
@@ -1,4 +1,3 @@
-import "../../chunk-B2GA45YG.js";
 import { n as findRoute, t as createURL } from "../../helpers-XD4_pfkD.js";
 //#region src/client/url_builder.ts
 /**

Reproduction repo

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions