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

turbopack support #266

Open
wladpaiva opened this issue Jun 14, 2024 · 5 comments
Open

turbopack support #266

wladpaiva opened this issue Jun 14, 2024 · 5 comments
Assignees

Comments

@wladpaiva
Copy link

By default, when using turbopack dev it throws an error

@apps/www:dev: [next]  ⨯ ModuleBuildError: ./apps/@www/videos/payments.mp4
@apps/www:dev: [next] Unknown module type
@apps/www:dev: [next] This module doesn't have an associated type. Use a known file extension, or register a loader for it.
@apps/www:dev: [next] 
@apps/www:dev: [next] Read more: https://nextjs.org/docs/app/api-reference/next-config-js/turbo#webpack-loaders
@ryanleecode
Copy link

+1

@luwes
Copy link
Collaborator

luwes commented Jun 27, 2024

Thanks for reporting!

yes, for now turbopack doesn't support inline webpack loaders which next-video uses for the video type.

we might need to export this as a separate package to make this to work.
not sure if we'll get to this before Turbopack reaches parity.

@luwes
Copy link
Collaborator

luwes commented Nov 1, 2024

I did some digging again and the blocker is Turbopack requires support for importing binaries (raw) files (mp4's).
vercel/next.js#72147

@luwes luwes self-assigned this Nov 1, 2024
@kevinschaich
Copy link

Tried this today and managed to get a few steps in but it's still complaining about them when I view one of the pages

    experimental: {
        turbo: {
            resolveExtensions: ['.mdx', '.tsx', '.ts', '.jsx', '.js', '.mjs', '.json', '.mp4'],
            rules: {
                './videos/*.mp4': {
                    loaders: ['next-video/webpack/video-raw-loader.js'],
                    as: '*.json',
                },
                './videos/*.mp4.json': {
                    loaders: ['next-video/webpack/video-json-loader.js'],
                    as: '*.json',
                },
            },
        },
    },

Extension seems to be wrong:

Failed to compile

./videos/coblocks-ai.mp4.json.json
Code generation for chunk item errored
An error occurred while generating the chunk item [project]/videos/coblocks-ai.mp4.json.json (json)

Caused by:
- failed to convert rope into string
- invalid utf-8 sequence of 1 bytes from index 35

@luwes
Copy link
Collaborator

luwes commented Nov 11, 2024

yes, thanks for digging in! Turbopack is trying to convert the imported file to a string I believe which is not we want. it should stay raw (binary)

@luwes luwes removed the enhancement label Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants