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

TypeError when dynamically importing the stream module #1393

Closed
develohpanda opened this issue Dec 29, 2023 · 2 comments
Closed

TypeError when dynamically importing the stream module #1393

develohpanda opened this issue Dec 29, 2023 · 2 comments
Labels

Comments

@develohpanda
Copy link
Contributor

develohpanda commented Dec 29, 2023

Description

Hi again! I have been getting Vike set up with vite-node, and I'm coming up stuck with the following error. Of note to my set up is that I have streaming enabled via https://github.com/brillout/react-streaming.

Note: please see my comment related to vite-node here as well.

image

Stack trace:

TypeError: A dynamic import callback was not specified.
    at importModuleDynamicallyCallback (node:internal/modules/esm/utils:182:9)
    at eval (eval at dynamicImport (C:\dev\Intergen.EventTools\Client\node_modules\vike\dist\esm\utils\dynamicImport.js:3:12), <anonymous>:3:1)
    at Module.dynamicImport (C:\dev\Intergen.EventTools\Client\node_modules\vike\dist\esm\utils\dynamicImport.js:3:53)
    at loadStreamNodeModule (C:\dev\Intergen.EventTools\Client\node_modules\vike\dist\esm\node\runtime\html\stream.js:780:54)
    at createStreamWrapper (C:\dev\Intergen.EventTools\Client\node_modules\vike\dist\esm\node\runtime\html\stream.js:426:36)
    at Module.processStream (C:\dev\Intergen.EventTools\Client\node_modules\vike\dist\esm\node\runtime\html\stream.js:266:62)
    at renderHtmlStream (C:\dev\Intergen.EventTools\Client\node_modules\vike\dist\esm\node\runtime\html\renderHtml.js:85:27)
    at Module.renderDocumentHtml (C:\dev\Intergen.EventTools\Client\node_modules\vike\dist\esm\node\runtime\html\renderHtml.js:55:35)
    at Module.executeOnRenderHtmlHook (C:\dev\Intergen.EventTools\Client\node_modules\vike\dist\esm\node\runtime\renderPage\executeOnRenderHtmlHook.js:42:24)
    at Module.renderPageAlreadyRouted (C:\dev\Intergen.EventTools\Client\node_modules\vike\dist\esm\node\runtime\renderPage\renderPageAlreadyRouted.js:80:30)�[39m

If I change the implementation of dynamicImport to the following, it seems to work just fine with the page rendering as expected. Could you please help me understand why you've chosen to use the syntax you have?

image

Specifics of my Windows 10 environment:

vite 5.0.10
vike 0.4.152
vite-node 1.1.0
react-streaming 0.3.15
node 20.10.0

Please let me know if there's any other information I can provide to help with debugging. 😊 As yet I have not reproduced this with one of the examples, but I will try do so to create a minimal reproduction.

@brillout
Copy link
Member

Fix pre-released in 0.4.152-commit-06c1fd5. Let me know if you still run into any issue.

@brillout
Copy link
Member

Btw. would your company be up for sponsoring?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants