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

nested SSR pages (and API routes) are throwing a module not found error (needs additional patch for adapters) #1223

Closed
thescientist13 opened this issue Apr 26, 2024 · 1 comment · Fixed by #1224, #1236 or #1237
Assignees
Labels
alpha.4 bug Something isn't working CLI P0 Critical issue that should get addressed ASAP SSR v0.29.3 v0.30.0
Milestone

Comments

@thescientist13
Copy link
Member

Summary

Haven't tested for production yet, but at least when running greenwood develop and having a nested SSR page route, e.g.

src/
  pages/
    blog/
      index.js

Will output

Started local development server at http://localhost:1984
      Develop command with HTML route response using default export and nested SSR page
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/owenbuckley/Workspace/project-evergreen/greenwood/packages/cli/test/cases/develop.ssr/src/pages/index.js' imported from /Users/owenbuckley/Workspace/project-evergreen/greenwood/packages/cli/src/lib/execute-route-module.js
    at new NodeError (node:internal/errors:405:5)
    at finalizeResolution (node:internal/modules/esm/resolve:327:11)
    at moduleResolve (node:internal/modules/esm/resolve:980:10)
    at defaultResolve (node:internal/modules/esm/resolve:1193:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:404:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:373:25)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:250:38)
    at ModuleLoader.import (node:internal/modules/esm/loader:336:34)
    at importModuleDynamically (node:internal/modules/esm/translators:143:35)
    at importModuleDynamicallyCallback (node:internal/modules/esm/utils:176:14) {
  url: 'file:///Users/owenbuckley/Workspace/project-evergreen/greenwood/packages/cli/test/cases/develop.ssr/src/pages/index.js',
  code: 'ERR_MODULE_NOT_FOUND'

Details

If you notice in the path shown in the error, the blog/ segment is missing

Cannot find module '/Users/owenbuckley/Workspace/project-evergreen/greenwood/packages/cli/test/cases/develop.ssr/src/pages/index.js' 
@thescientist13
Copy link
Member Author

thescientist13 commented May 4, 2024

Argh, completely forgot to test for adapters and this is definitely not working based on some local testing I just conducted for this, so need to re-open 😞

@thescientist13 thescientist13 reopened this May 4, 2024
@thescientist13 thescientist13 changed the title nested SSR pages throwing a module not found error nested SSR pages throwing a module not found error (needs additional patch for adapters) May 4, 2024
@thescientist13 thescientist13 linked a pull request Jun 2, 2024 that will close this issue
5 tasks
@thescientist13 thescientist13 changed the title nested SSR pages throwing a module not found error (needs additional patch for adapters) nested SSR pages (and API routes) are throwing a module not found error (needs additional patch for adapters) Jun 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment