Typescript error: gray-matter.d.ts(43,11): error TS2304: Cannot find name 'Buffer' #68
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Since Buffer is not available in the browser, when compiling without
nodetypes, this error is throw.This unfortunately also makes the library almost unusable for Angular based projects since they no longer supply shims for node types that don't exist in the browser in the Angular CLI.
This is an excellent point.
Looking at the typings, it seems that Buffer is used, unnecessarily in one place and for an input type in another. I think we can remove it from the typings and provide and example in the Readme to show how to use buffers instead of strings.
However, to make such a change would be a breaking change, not to the APIs but to the types.
@jonschlinkert my proposal would be:
gray-matter.@jonschlinkert What is the process WRT releasing a new major release? When we are ready?
I can easily install
@types/node, but apparently, this is not compatible with@types/webpack-envI found a solution, if I need to browserify or Webpack,
This makes gray-matter difficult to use in Deno. It seems to work (without proper types) from https://jspm.dev, but fails from https://cdn.pika.dev (but types work).