TypeError: Cannot read properties of undefined (reading 'readVint')
Trying to upgrade from 2.x to 3.x in my Angular project and receiving the error message: TypeError: Cannot read properties of undefined (reading 'readVint')
I didn't see any docs about changes from 2.x to 3.x, so I just updated the library and thought I would give it try. I think it is complaining about tools. I am using - const refinedMetadataBuf = ebml.tools.makeMetadataSeekable(..) or just tools.makeMetadataSeekable with import * as ebml from 'ts-ebml' and import { Decoder, tools, Reader} from 'ts-ebml' respectively. I also tried to alias the include of the tools in case of conflict.
Is there another dependent library I need to include with the 3.x Version?
Thanks.
Same here in React. It is trying to import tools from ebml
You would need to rewire React webpack and include Ebml and Buffer
You would need to rewire React webpack and include Ebml and Buffer
what do you mean? could you please provide a code/solution?
Anyone able to get this to work with Angular?
I didn't try and to deep to find out why but so far only way I would make it work, more or less
Include EBML.js in your public folder <script ....
import {
type EBMLElementDetail,
} from 'ts-ebml';
declare var EBML: typeof import('ts-ebml');
Same problme in Nuxt 3 (Vue 3).
Solved in Vite using:
import commonjs from "vite-plugin-commonjs";
import { nodePolyfills } from 'vite-plugin-node-polyfills'
...
export default defineConfig({
...
plugins: [
nodePolyfills({
include: ['buffer'],
globals: {
Buffer: true,
},
}),
commonjs({
filter(id) {
return id.includes('node_modules/ts-ebml')
},
}),
...
],
})
Also met this in nextjs15, what should I do ?
nuxtjs4 fix by import * as ebml from "ts-ebml/dist/EBML.min.js";