kontrollanten / babel-plugin-preact-fragment Goto Github PK
View Code? Open in Web Editor NEWReact.Fragment babel transpiler for preact applications
Home Page: https://www.npmjs.com/package/babel-plugin-preact-fragment
React.Fragment babel transpiler for preact applications
Home Page: https://www.npmjs.com/package/babel-plugin-preact-fragment
Your plugin works well on compilation for preact, but, don't work as expected in runtime.
When fragment have more than one child, all the Fragment and his content is ignored (deleted).
Hello, I've tried your plugin, but I have this issue :
Uncaught Error: Module build failed (from ./node_modules/babel-loader/lib/index.js):
TypeError: Property body[0] of BlockStatement expected node to be of a type ["Statement"] but instead got "JSXText"
at validate (/app/node_modules/@babel/types/lib/definitions/utils.js:128)
at validator (/app/node_modules/@babel/types/lib/definitions/utils.js:97)
at Object.validate (/app/node_modules/@babel/types/lib/definitions/utils.js:172)
at validate (/app/node_modules/@babel/types/lib/validators/validate.js:17)
at builder (/app/node_modules/@babel/types/lib/builders/builder.js:46)
at Object.BlockStatement (/app/node_modules/@babel/types/lib/builders/generated/index.js:256)
at NodePath.replaceExpressionWithStatements (/app/node_modules/@babel/traverse/lib/path/replacement.js:209)
at NodePath.insertAfter (/app/node_modules/@babel/traverse/lib/path/modification.js:128)
at NodePath.replaceWithMultiple (/app/node_modules/@babel/traverse/lib/path/replacement.js:85)
at PluginPass.JSXElement (/app/node_modules/babel-plugin-preact-fragment/lib/index.js:27)
at newFn (/app/node_modules/@babel/traverse/lib/visitors.js:193)
at NodePath._call (/app/node_modules/@babel/traverse/lib/path/context.js:53)
at NodePath.call (/app/node_modules/@babel/traverse/lib/path/context.js:40)
at NodePath.visit (/app/node_modules/@babel/traverse/lib/path/context.js:88)
at TraversalContext.visitQueue (/app/node_modules/@babel/traverse/lib/context.js:118)
at TraversalContext.visitMultiple (/app/node_modules/@babel/traverse/lib/context.js:85)
at TraversalContext.visit (/app/node_modules/@babel/traverse/lib/context.js:144)
at Function.traverse.node (/app/node_modules/@babel/traverse/lib/index.js:94)
at NodePath.visit (/app/node_modules/@babel/traverse/lib/path/context.js:95)
at TraversalContext.visitQueue (/app/node_modules/@babel/traverse/lib/context.js:118)
at TraversalContext.visitSingle (/app/node_modules/@babel/traverse/lib/context.js:90)
at TraversalContext.visit (/app/node_modules/@babel/traverse/lib/context.js:146)
at Function.traverse.node (/app/node_modules/@babel/traverse/lib/index.js:94)
at NodePath.visit (/app/node_modules/@babel/traverse/lib/path/context.js:95)
at TraversalContext.visitQueue (/app/node_modules/@babel/traverse/lib/context.js:118)
at TraversalContext.visitMultiple (/app/node_modules/@babel/traverse/lib/context.js:85)
at TraversalContext.visit (/app/node_modules/@babel/traverse/lib/context.js:144)
at Function.traverse.node (/app/node_modules/@babel/traverse/lib/index.js:94)
at NodePath.visit (/app/node_modules/@babel/traverse/lib/path/context.js:95)
at TraversalContext.visitQueue (/app/node_modules/@babel/traverse/lib/context.js:118)
at eval (webpack-internal:///Qkh4:1)
at Object.Qkh4 (main.js:1195)
at __webpack_require__ (runtime.js:79)
at eval (webpack-internal:///ffBH:3)
at Object.eval (webpack-internal:///ffBH:8)
at eval (webpack-internal:///ffBH:261)
at Object.ffBH (main.js:2006)
at __webpack_require__ (runtime.js:79)
at eval (webpack-internal:///ggSr:3)
at Object.eval (webpack-internal:///ggSr:8)
The issue Property body[0] of BlockStatement expected node to be of a type ["Statement"] but instead got "JSXText"
says that the node return have not the good type..
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.