question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

export feature does not work unless surrounded by newlines

See original GitHub issue

This is a strange issue, but finally found the source after digging for a bit. Basically, if you run an export, like this, but do not include newlines around the export, it is not detected at all, and will drop the export verbatim as a string into the resulting mdx file. As far as I know, es6 modules do not have any rules around adding extra newlines, so the behavior was pretty confusing to me.

I would be more than happy to submit a patch to fix this, just want to make sure that the maintainer(s) of the library give me the green light first!

To reproduce - this works:

import Layout from './Layout'

export default ({ children }) => <Layout some='metadata' >{children}</Layout>

# Hello, world!

However, this does not:

import Layout from './Layout'
export default ({ children }) => <Layout some='metadata' >{children}</Layout>

# Hello, world!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
johnocommented, Feb 15, 2019

I’m going to preemptively close this because it will be supported in 0.18 that should go out next week. Thanks for opening up the issue!

0reactions
johnocommented, Nov 29, 2018

The other thing is introducing a substantially larger bundle size (for the library itself not the output which affects things like the runtime), but that might be inevitable to ensure our parsing is solid. It’s definitely something I’m open to, but might make sense as its own issue to weigh the pros and cons to kick off such an initiative.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Need to export fields containing linebreaks as a CSV from ...
This solved my problem. I was having problems when copying SQL Server table results to excel as a result of a string field...
Read more >
Jira import issues via CSV - Embedded newlines in
Solved: I am migrating issues from one Jira instance (the source) to another Jira instance (the destination). I am exporting issues via CSV ......
Read more >
csv export not valid for excel - Support : DbVis Software
I have searched the forums for csv export and have not been able to find a way to export the query results in...
Read more >
Postico User Guide - Importing and Exporting Data - Egger Apps
This allows CSV to store data that contains special characters like the field separator or newlines. Postico also uses quotes: Numeric values are...
Read more >
Excel formatting and features that are not transferred to other ...
If you save a workbook in another file format, such as a text file format, some of the formatting and data might be...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found