Skip to content
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

Bug: issue upgrading to v1 #841

Closed
huchenme opened this issue Apr 29, 2019 · 2 comments
Closed

Bug: issue upgrading to v1 #841

huchenme opened this issue Apr 29, 2019 · 2 comments

Comments

@huchenme
Copy link

Bug Report

Describe the bug

Our company got our own babel preset which is similar to create-react-app preset, we always use it for build and compiling, I have removed the code which make use of that preset, but I found our preset could not work together with babel-plugin-export-metadata

To Reproduce

  1. git clone https://github.com/huchenme/docz-v1-issue-demo
  2. yarn install (need to use yarn)
  3. yarn start
 error  in ./packages/core/Button/index.js

Module build failed (from ./node_modules/docz-core/node_modules/babel-loader/lib/index.js):
TypeError: @babel/template placeholder "NAME": Property declaration of ExportDefaultDeclaration expected node to be of a type ["FunctionDeclaration","TSDeclareFunction","C
lassDeclaration","Expression"] but instead got null
    at Object.validate (/Users/chen/projects/github/docz-v1-demo/node_modules/@babel/types/lib/definitions/utils.js:128:13)
    at Object.validate (/Users/chen/projects/github/docz-v1-demo/node_modules/@babel/types/lib/validators/validate.js:17:9)
    at applyReplacement (/Users/chen/projects/github/docz-v1-demo/node_modules/@babel/template/lib/populate.js:113:9)
    at metadata.placeholders.slice.reverse.forEach.placeholder (/Users/chen/projects/github/docz-v1-demo/node_modules/@babel/template/lib/populate.js:42:7)
    at Array.forEach (<anonymous>)
    at populatePlaceholders (/Users/chen/projects/github/docz-v1-demo/node_modules/@babel/template/lib/populate.js:40:43)
    at arg (/Users/chen/projects/github/docz-v1-demo/node_modules/@babel/template/lib/string.js:22:51)
    at arg (/Users/chen/projects/github/docz-v1-demo/node_modules/@babel/template/lib/builder.js:77:14)
    at renameDefaultAddFileMetaProperties (/Users/chen/projects/github/docz-v1-demo/node_modules/babel-plugin-export-metadata/src/index.js:61:22)
    at PluginPass.<anonymous> (/Users/chen/projects/github/docz-v1-demo/node_modules/babel-plugin-export-metadata/src/index.js:98:9)
    at newFn (/Users/chen/projects/github/docz-v1-demo/node_modules/@babel/traverse/lib/visitors.js:193:21)
    at NodePath._call (/Users/chen/projects/github/docz-v1-demo/node_modules/@babel/traverse/lib/path/context.js:53:20)
    at NodePath.call (/Users/chen/projects/github/docz-v1-demo/node_modules/@babel/traverse/lib/path/context.js:40:17)
    at NodePath.visit (/Users/chen/projects/github/docz-v1-demo/node_modules/@babel/traverse/lib/path/context.js:88:12)
    at TraversalContext.visitQueue (/Users/chen/projects/github/docz-v1-demo/node_modules/@babel/traverse/lib/context.js:118:16)
    at TraversalContext.visitMultiple (/Users/chen/projects/github/docz-v1-demo/node_modules/@babel/traverse/lib/context.js:85:17)
    =============
    at Object.<anonymous> (/Users/chen/projects/github/docz-v1-demo/node_modules/babel-plugin-export-metadata/src/index.js:18:30)
    at Module._compile (module.js:635:30)
    at Module._compile (/Users/chen/projects/github/docz-v1-demo/node_modules/pirates/lib/index.js:99:24)
    at Module._extensions..js (module.js:646:10)
    at Object.newLoader [as .js] (/Users/chen/projects/github/docz-v1-demo/node_modules/pirates/lib/index.js:104:7)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Module.require (module.js:579:17)
    at require (internal/module.js:11:18)
    at requireModule (/Users/chen/projects/github/docz-v1-demo/node_modules/docz-core/node_modules/@babel/core/lib/config/files/plugins.js:165:12)
    at loadPlugin (/Users/chen/projects/github/docz-v1-demo/node_modules/docz-core/node_modules/@babel/core/lib/config/files/plugins.js:68:17)
    at createDescriptor (/Users/chen/projects/github/docz-v1-demo/node_modules/docz-core/node_modules/@babel/core/lib/config/config-descriptors.js:154:9)
    at items.map (/Users/chen/projects/github/docz-v1-demo/node_modules/docz-core/node_modules/@babel/core/lib/config/config-descriptors.js:109:50)

 @ ./packages/core/Button/README.mdx 15:0-44 70:8-14 92:14-20 93:17-26 103:9-15
 @ ./.docz/app/imports.js
 @ ./.docz/app/root.jsx
 @ ./.docz/app/index.jsx
 @ multi ./node_modules/react-dev-utils/webpackHotDevClient.js ./.docz/app/index.jsx

Expected behavior

It should show documentation

Environment

  • OS: OSX 10.14.1
  • Node/npm version: Node 8.9.0
@smeijer
Copy link

smeijer commented May 7, 2019

I'm having the same issue for @babel/plugin-proposal-export-default-from, a plugin that my codebase depends on.

TypeError: @babel/template placeholder "NAME": Property declaration of ExportDefaultDeclaration expected node to be of a type ["FunctionDeclaration","TSDeclareFunction","ClassDeclaration","Expression"] but instead got null
    at Array.forEach (<anonymous>)

@huchenme
Copy link
Author

huchenme commented Oct 2, 2019

@rakannimer what is the reason this issue get closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants