Have your say in Community Polls: What was/is your greatest motivation to start your own business?

Remix App : Issue with Importing File: "Server-only module referenced by client"

Solved

Remix App : Issue with Importing File: "Server-only module referenced by client"

rkmsoftware
Shopify Partner
17 2 4

Hello everyone,

I'm encountering an issue while trying to import a file in my Shopify app. Specifically, I get the following error message:

Server-only module referenced by client: '../db.server' imported by route 'app/routes/app.import.jsx'

It seems like there's a conflict between server-side and client-side modules. I’ve checked my import paths and tried a few things, but I haven’t been able to resolve it.

Has anyone faced a similar issue or have any suggestions on how to fix this? Any guidance would be greatly appreciated!

Thank you!

 

Accepted Solution (1)

rkmsoftware
Shopify Partner
17 2 4

This is an accepted solution.

I have fixed this issue on my end. Thanks

View solution in original post

Replies 3 (3)

rkmsoftware
Shopify Partner
17 2 4

This is an accepted solution.

I have fixed this issue on my end. Thanks

josafatgarciasa
Shopify Partner
3 0 0

Hey, how did you solve it? I'm experiencing the same issue

rkmsoftware
Shopify Partner
17 2 4

@josafatgarciasaDo not import shopify.server until you fetch the data using the Loader Function.