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

Links in published nextjs site exported for github display a spinner #1588

Open
1 of 6 tasks
ragamroll opened this issue Oct 26, 2021 · 3 comments
Open
1 of 6 tasks
Labels
scope.publish Static site generation, sending note links and anything to do with publishing your notes. status.triage-needed type.bug Something isn't working

Comments

@ragamroll
Copy link

Please select the area your bug applies to. (Multiple selections are Possible)

  • Onboard. Initial vault setup and import/export pods
  • Create. Note creation, lookup, snippets and templates
  • Retrieve. Backlinks, references, graph view
  • Structure. Refactoring, multi-vault and schemas
  • Publish. Sharing your repo with the world
  • Misc (Choose this if your not sure)

Describe the bug

Clicking on any links to notes (in the dendron valut) in the main content, replaces main content with a spinner spinning forever.

To Reproduce

Steps to reproduce the behavior:

Publish a dendron vault to export to github and serve it locally
npx dendron publish --wsRoot . export --target github && npx serve -s docs

Visit http://localhost:5000 (or whatever url the docs folder is served from)
dendron_nextjs_site_spinner
dendron_nextjs_site_local

Expected behavior

Clicking on any link in the main content section that should show one of the notes in the vault should show that particular note.

Screenshots

Attached are two screenshots.

  1. showing the local site as soon as it is loaded in google-chrome
  2. showing the spinner when any of the links in the main content area is clicked

Desktop (please complete the following information)

  • OS: Ubuntu 20.04.3 LTS
  • Browser: Google Chrome
  • Version: 95.0.4638.54 (Official Build) (64-bit)

Additional context

Command used to export and serve the static site

$ yes | npx dendron publish --wsRoot . export --target github && npx serve -s docs
generating metadata for publishing...
removing existing assets

> @dendronhq/nextjs-template@0.63.4-alpha.0 export /home/user1/Dendron/.next
> next build && next export

info  - Using webpack 5. Reason: Enabled by default https://nextjs.org/docs/messages/webpack5
info  - Checking validity of types...
info  - Creating an optimized production build...
info  - Compiled successfully
info  - Collecting page data...
info  - Generating static pages (0/30)
info  - Generating static pages (7/30)
info  - Generating static pages (14/30)
info  - Generating static pages (22/30)
info  - Generating static pages (30/30)
info  - Finalizing page optimization...

Page                                          Size     First Load JS
┌ ● / (2027 ms)                               1.94 kB         792 kB
├   /_app                                     0 B             778 kB
├ ○ /404                                      195 B           778 kB
├ λ /api/hello                                0 B             778 kB
└ ● /notes/[id] (28854 ms)                    1.94 kB         792 kB
    ├ /notes/X6Z4CQPHgZWt1lJpf9Ygt (2112 ms)
    ├ /notes/wMfmX5QbKsJR137rzZoc8 (2097 ms)
    ├ /notes/2VYHTvjD2E3KqoP7GZsGn (2081 ms)
    ├ /notes/403 (2072 ms)
    ├ /notes/cDbloelu4d6iJPQqUga2h (2071 ms)
    ├ /notes/WWDot6zeIlwGEyteTUT6Q (2061 ms)
    ├ /notes/VPk7hWuDJw8VY9z3BbVIU (2060 ms)
    └ [+20 more paths] (avg 715 ms)
+ First Load JS shared by all                 778 kB
  ├ chunks/framework.2f6124.js                42.4 kB
  ├ chunks/main.12873c.js                     23.7 kB
  ├ chunks/pages/_app.2103a5.js               711 kB
  ├ chunks/webpack.613fd8.js                  886 B
  └ css/277fdfe9b7022c9c8577.css              95.6 kB

λ  (Server)  server-side renders at runtime (uses getInitialProps or getServerSideProps)
○  (Static)  automatically rendered as static HTML (uses no initial props)
●  (SSG)     automatically generated as static HTML + JSON (uses getStaticProps)
   (ISR)     incremental static regeneration (uses revalidate in getStaticProps)

info  - Using webpack 5. Reason: Enabled by default https://nextjs.org/docs/messages/webpack5
info  - using build directory: /home/user1/Dendron/.next/.next
info  - Copying "static build" directory
info  - No "exportPathMap" found in "next.config.js". Generating map from "./pages"
info  - Launching 15 workers
info  - Exporting (0/2)
info  - Copying "public" directory
info  - Exporting (2/2)
Export successful. Files written to /home/user1/Dendron/.next/out
building github target...
✔ Docs folder exists. Delete? … yes
done export. files available at docs
npx: installed 88 in 3.253s

   ┌───────────────────────────────────────────────────┐
   │                                                   │
   │   Serving!                                        │
   │                                                   │
   │   - Local:            http://localhost:5000       │
   │   - On Your Network:  http://192.168.2.233:5000   │
   │                                                   │
   │   Copied local address to clipboard!              │
   │                                                   │
   └───────────────────────────────────────────────────┘

Dendron Log file

Please attach the output of > Dev:Dendron: Open Logs here

@github-actions github-actions bot added scope.publish Static site generation, sending note links and anything to do with publishing your notes. status.triage-needed type.bug Something isn't working labels Oct 26, 2021
@ragamroll
Copy link
Author

Thanks to SO ( https://stackoverflow.com/questions/67034554/nextjs-url-not-working-after-getting-exported )

This issue was resolved when I ran

npx serve docs

instead of

npx serve -s docs

However, one issue still remains. There are backlinks to "Dendron vault" in the exported site, that point to the path /notes/root which generates a 404.

@jonathanyeung
Copy link
Contributor

Hi @ragamroll, thanks for reporting the issue.

We have a more streamlined way to do publishing, which can be found here: https://wiki.dendron.so/notes/LHsoPfTqvaJcfFA4WfEtv/

However, one issue still remains. There are backlinks to "Dendron vault" in the exported site, that point to the path /notes/root which generates a 404.

Do you have a multi-vault setup? Is it possible that the backlinks for which you're seeing 404's are part of a separate vault that isn't being published as part of your preview?

@ragamroll
Copy link
Author

ragamroll commented Oct 27, 2021

Hi @jonathanyeung,
Thank you for the prompt response.

I have been following the instructions in the link that you shared, while I noticed this issue.

I do have multiple Dendron workspaces (in separate directories) that I have created in the process of learning to use Dendron. However, there are no links across vaults.

I tried to reproduce the issue by creating a fresh workspace with just two nodes. I notice this problem when I link to other notes within root.md. This creates a backlink to root in those notes, with the path /notes/<id of root>, whereas the path for root on the side navigation is /.

I have attached a zip of the whole directory. test1.zip

Here are my versions.
dendron --version
0.65.0
node --version
v14.18.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope.publish Static site generation, sending note links and anything to do with publishing your notes. status.triage-needed type.bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants