babel-plugin-preval
babel-plugin-preval copied to clipboard
Bug: throw Unexpected Name when pass string literal
-
babel-plugin-preval
version: 5.0.0 (preval.macro 3.0.0) -
node
version: v14.16.1 -
npm
(oryarn
) version: 6.14.12
Relevant code or config
export const searchPosts = preval`
const tool = require('../../graphql/utils');
module.exports = tool.maxDepth("searchPosts", 2);
`
What happened:
The "searchPosts"
supposed to be a string literal, but this is what happened
preval.macro: Syntax Error: Unexpected Name "searchPosts". Learn more: https://www.npmjs.com/package/preval.macro
Reproduction repository: I'll provide it when needed