-
Notifications
You must be signed in to change notification settings - Fork 103
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
SubtitlesOctopus Nextjs Runtime Error #157
Comments
Subtitle octopus does not provide typescript definitions (it could if #95 is merged one day). To include types, you must create a I created this file by copy-pasting the |
Same Error The error is probably from the worker when I comment the worker option function Subtitles() {
var options: any = {
video: document.querySelector("video"),
subUrl: MainDomain + eng,
// workerUrl: new URL("libass-wasm/dist/js/subtitles-octopus-worker.js", import.meta.url),
};
var instance = new SubtitlesOctopus(options);
} |
Did you ever find a fix for this @Abdullah-988? Running into the same issue |
It seems that the issue was workerUrl and its options I fixed the issue by copying the dist folder from make sure you install /** @type {import('next').NextConfig} */
const CopyWebpackPlugin = require("copy-webpack-plugin");
const nextConfig = {
webpack: (config, { isServer }) => {
config.plugins.push(
new CopyWebpackPlugin({
patterns: [
{
from: "node_modules/libass-wasm/dist/js",
to: `${isServer ? "../" : ""}static`,
},
],
})
);
return config;
},
reactStrictMode: true,
};
module.exports = nextConfig; in the function: var instance = new SubtitlesOctopus({
video: video,
subUrl: MainDomain + Source,
useLocalFonts: false,
prescaleFactor: 3,
availableFonts: {
Font: "https://yourfonturl.com"
},
fallbackFont: "https://yourfonturl.com",
fonts: [ "https://yourfonturl.com" ],
workerUrl: "/_next/static/subtitles-octopus-worker.js" // <---------
// or
workerUrl: "/static/subtitles-octopus-worker.js"
}); |
I've been trying to solve this problem since forever
when using SubtitlesOctopus with Nextjs project I always get errors like
I'm using Nextjs With Typescript
My code:
I would be appreciated If someone know how to solve this issue or If someone can make a repo example of how to use SubtitlesOctopus with Nextjs Typescript
Thank You!
The text was updated successfully, but these errors were encountered: