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

no preview for csv file #250

Open
PierreMarchand20 opened this issue Feb 18, 2021 · 43 comments
Open

no preview for csv file #250

PierreMarchand20 opened this issue Feb 18, 2021 · 43 comments

Comments

@PierreMarchand20
Copy link

Sorry for the naive question, but I cannot preview a simple csv file:
image

Am I missing something ? here is the log

> window.WebComponentsReady

 data viewer initialized!

> data size in bytes: 0

> document.readystatechange complete

 data.view:complete!

> loadDataInfo()

 data url: file://path/to/elliptic_cavity_2D_10_combined_dir_direct_eig.csv
 data table: 

> restoreConfig(
{})

> loadTableList(
 tableNames = []
 requestedDataTable = ''
)

> refresh(dataTable='')

 loading data: elliptic_cavity_2D_10_combined_dir_direct_eig.csv ...

> getData()

 loading file data: elliptic_cavity_2D_10_combined_dir_direct_eig.csv ...

> getData()

 records count: 75

> refresh('')

 updating view data: elliptic_cavity_2D_10_combined_dir_direct_eig.csv ...

> 
@RandomFractals RandomFractals changed the title no preview for css file no preview for csv file Feb 25, 2021
@RandomFractals
Copy link
Owner

@PierreMarchand20 do you see any errors in Help -> Toggle Developer Tools when you run it?

@PierreMarchand20
Copy link
Author

I have this :

image

@mrsoftowl
Copy link

mrsoftowl commented Feb 25, 2021

Similar to PierreMarchand20

Screen Shot 2021-02-25 at 6 18 17 PM

Weirdly enough, toggling Developer Tools and refreshing a few times will occasionally trigger a load of the data.

@RandomFractals
Copy link
Owner

yeah, I need to look into this. That updateStats call just reports the number of records read from a data file and size in vscode status bar and ext. log.

Thank you for sharing your error outputs.

@mrsoftowl
Copy link

yeah, I need to look into this. That updateStats call just reports the number of records read from a data file and size in vscode status bar and ext. log.

Thank you for sharing your error outputs.

Let me know if you need something else. Your plugin, after Jupyter Notebooks, is the key reason to recommend VSCode... Coffee inbound.

@RandomFractals RandomFractals added the bug Something isn't working label Feb 26, 2021
@oolonek
Copy link

oolonek commented Feb 28, 2021

Exact same error as @PierreMarchand20 and @mrsoftowl over here !

@ivaquero
Copy link

Hi there, as far as I find, the error is caused by the dark theme. Change the theme to light to fix it temporarily.

@programmiererei
Copy link

Changing theme has no effect on my installation

@RandomFractals
Copy link
Owner

RandomFractals commented Feb 28, 2021

so, after updating to vscode v1.53.2 I can finally reproduce this for a dark data preview theme. I was not able to do it with the initial v1.53 release. Also, interestingly enough an older data preview I had open for zipcodes while testing with earlier version of that vscode release worked, while creating new data preview after vscode update to latest did not.

Oddly enough, changing data preview to light theme works.

data-preview-dense-light

If you want to try it, just change data preview theme setting in Preferences -> Settings -> Extensions -> Data Preview -> Theme

or set it in .vscode/settings.json for your project similar to: https://github.com/RandomFractals/vscode-data-preview/blob/master/.vscode/settings.json

I'll see if I can debug and patch this soon. It's a bit tricky and I suspect there is more to it than that error we get. Thanks for your patience.

@RandomFractals
Copy link
Owner

RandomFractals commented Mar 6, 2021

I am going to try this with new vscode v1.54 release today. I was not able to find the origin of this issue for the dark theme and that css is not much different from the stylesheet I am using for light data preview theme. I do suspect new built-in vscode table widget or something else related to webview loading has something to do with it since after fixing that stats update call I saw some Table trace logs that I did not recognize. Will try it in the latest vscode v. and keep you posted.

@Denzo77
Copy link

Denzo77 commented Mar 8, 2021

Both light and dark scheme fail randomly for me, with light theme seeming to work a bit more reliably. (light loaded data 6 out of 10 tries, dark loaded it 4 out of 10 tries).

FWIW, I get a similar but slightly different error as well. It might just be a linux thing though (vscode v1.54.1).

[[object Object]]Cannot read property 'toFixed' of undefined
$onExtensionRuntimeError @ mainThreadExtensionService.ts:59
mainThreadExtensionService.ts:60 TypeError: Cannot read property 'toFixed' of undefined
	at Object.formatBytes (~/.vscode/extensions/randomfractalsinc.vscode-data-preview-2.3.0/out/utils/file.utils.js:95)
	at DataPreview.updateStats (~/.vscode/extensions/randomfractalsinc.vscode-data-preview-2.3.0/out/data.preview.js:344)
	at ~/.vscode/extensions/randomfractalsinc.vscode-data-preview-2.3.0/out/data.preview.js:205
	at p.fire (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:57)
	at r._updateViewState (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:88)
	at s.$onDidChangeWebviewPanelViewStates (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:88)
	at u._doInvokeHandler (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:90)
	at u._invokeHandler (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:90)
	at u._receiveRequest (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:90)
	at u._receiveOneMessage (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:90)
	at /usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:90
	at p.fire (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:57)
	at g.fire (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:65)
	at /usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:106
	at p.fire (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:57)
	at g.fire (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:65)
	at t._receiveMessage (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:65)
	at /usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:65
	at p.fire (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:57)
	at l.acceptChunk (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:65)
	at /usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:65
	at Socket.E (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:106)
	at Socket.emit (events.js:315)
	at addChunk (_stream_readable.js:295)
	at readableAddChunk (_stream_readable.js:271)
	at Socket.Readable.push (_stream_readable.js:212)
	at Pipe.onStreamRead (internal/stream_base_commons.js:186)
$onExtensionRuntimeError @ mainThreadExtensionService.ts:60
mainThreadExtensionService.ts:59 [[object Object]]Cannot read property '0' of undefined
$onExtensionRuntimeError @ mainThreadExtensionService.ts:59
mainThreadExtensionService.ts:60 TypeError: Cannot read property '0' of undefined
	at parse_xlml_xml (~/.vscode/extensions/randomfractalsinc.vscode-data-preview-2.3.0/node_modules/xlsx/xlsx.js:16111)
	at parse_xlml (~/.vscode/extensions/randomfractalsinc.vscode-data-preview-2.3.0/node_modules/xlsx/xlsx.js:16530)
	at Object.readSync [as read] (~/.vscode/extensions/randomfractalsinc.vscode-data-preview-2.3.0/node_modules/xlsx/xlsx.js:21009)
	at ~/.vscode/extensions/randomfractalsinc.vscode-data-preview-2.3.0/out/data.providers/excel.data.provider.js:47
$onExtensionRuntimeError @ mainThreadExtensionService.ts:60

@S-Maciejewski
Copy link

Same problem for me, VS Code 1.54.1. Does not load, however it accurately shows number of rows and size in the bottom bar

@UbuntuScott
Copy link

Similar error for me with a .csv
Just can't preview for a comma and pipe delimited file
It did work for me the first time I installed the extension.
Every other times I've been prompted to" Open a Data file to Preview Source:Data Preview (Extension).

@jerryc05
Copy link

Same here. Light theme works with no error but dark theme failed with error:

[Embedded Page] Registered perspective-computed-column
workbench.desktop.main.js:1541 [Embedded Page] Registered perspective-row
workbench.desktop.main.js:1541 [Embedded Page] Registered perspective-viewer
workbench.desktop.main.js:1541 [Embedded Page] Registered perspective-hypergrid
workbench.desktop.main.js:1541 [Embedded Page] Registered perspective-d3fc-chart
workbench.desktop.main.js:1541 [Embedded Page] data.view:interactive!
workbench.desktop.main.js:1541 [Embedded Page] data.view:initializeDataView()

 initializing...
workbench.desktop.main.js:1541 [Embedded Page] data.view:window.WebComponentsReady

 data viewer initialized!
workbench.desktop.main.js:1541 [Embedded Page] data.view:data size in bytes: 0
workbench.desktop.main.js:1541 [Embedded Page] data.view:document.readystatechange complete

 data.view:complete!
workbench.desktop.main.js:1541 [Embedded Page] data.view:loadDataInfo()

 data url: file:///[hidden].csv
 data table: 
workbench.desktop.main.js:1541 [Embedded Page] data.view:restoreConfig(
{})
workbench.desktop.main.js:1541 [Embedded Page] data.view:loadTableList(
 tableNames = []
 requestedDataTable = ''
)
workbench.desktop.main.js:1541 [Embedded Page] data.view:refresh(dataTable='')

 loading data: [hidden].csv ...
workbench.desktop.main.js:1541 [Embedded Page] data.view:getData()

 loading file data: [hidden].csv ...
workbench.desktop.main.js:1541 [Embedded Page] data.view:getData()

 records count: 4
workbench.desktop.main.js:1541 [Embedded Page] data.view:refresh('')

 updating view data: [hidden].csv ...
workbench.desktop.main.js:1541 [Embedded Page] Transferable support detected
workbench.desktop.main.js:1541 [Embedded Page] Loading wasm
workbench.desktop.main.js:1541 [Embedded Page] Abort(): Failed to open RecordBatchStreamReader: Tried reading schema message, was null or length 0
workbench.desktop.main.js:1541 [Embedded Page] 
workbench.desktop.main.js:1541 [Embedded Page] Table initialization failed: Error: abort()
workbench.desktop.main.js:1541 [Embedded Page] Uncaught Error: abort()
2workbench.desktop.main.js:1541 [Embedded Page] Uncaught (in promise) #<Object>
workbench.desktop.main.js:1541 [Embedded Page] Uncaught Error: abort()
3workbench.desktop.main.js:1541 [Embedded Page] Uncaught (in promise) #<Object>

@jm3
Copy link

jm3 commented Mar 22, 2021

Can confirm that the extension will not preview CSV with theme Dark, but does work with theme: Light, and the first clue that I notice is columns: undefined in the footer.

@kartzke
Copy link

kartzke commented Mar 23, 2021

Hi, amazing extension! But sadly, I'm also getting preview issues with a large file (+26MB) in both light and dark themes. Refreshing the data in VS Code does not help much... I was able to get the data to load once, but I haven't been able to preview it since... at least 50 tries of refreshing and/or reopening the file.

In dev tools, i get similar errors as above. In the lower status bar, shows Columns: undefined

[Embedded Page] data.view:loadTableList(
 tableNames = []
 requestedDataTable = ''
)
webviewElement.ts:90 [Embedded Page] data.view:refresh(dataTable='')

 loading data: data.csv ...
webviewElement.ts:90 [Embedded Page] data.view:getData()

 loading file data: data.csv ...
webviewElement.ts:90 [Embedded Page] data.view:getData()

 records count: 43,374
webviewElement.ts:90 [Embedded Page] data.view:refresh('')

 updating view data: data.csv ...
[Embedded Page] Uncaught (in promise) #<Object>

@forybm
Copy link

forybm commented Mar 27, 2021

Same problem for me too.
Screen Shot 2021-03-27 at 14 56 03

VS code Version: 1.54.2
OS: Darwin x64 19.6.0

@RandomFractals
Copy link
Owner

RandomFractals commented Apr 6, 2021

well, it actually works on gitpod.io. So, I suspect there is a conflicting extension that stops it from working, or some faulty vscode update in the past two releases.

data-preview-gitpod-io

works with CSV files too. Try Data: Preview Remote data command and paste this data url: https://us-counties.datasette.io/counties/counties.csv

us-counties-data-preview

@RandomFractals RandomFractals removed the bug Something isn't working label Apr 7, 2021
@RandomFractals
Copy link
Owner

yep. just confirmed that it works in vscodium too. Please try uninstalling some data related extensions that might be causing that issue. I can't find the culprit.

image

@RandomFractals RandomFractals added the wontfix This will not be worked on label Apr 7, 2021
@RandomFractals
Copy link
Owner

PS: this is the problem and it's not coming from my extenion. something else steals data transfer to my webview:

workbench.desktop.main.js:1541 [Embedded Page] Transferable support detected
workbench.desktop.main.js:1541 [Embedded Page] Loading wasm
workbench.desktop.main.js:1541 [Embedded Page] Abort(): Failed to open RecordBatchStreamReader: Tried reading schema message, was null or length 0
workbench.desktop.main.js:1541 [Embedded Page] 
workbench.desktop.main.js:1541 [Embedded Page] Table initialization failed: Error: abort()
workbench.desktop.main.js:1541 [Embedded Page] Uncaught Error: abort()
2workbench.desktop.main.js:1541 [Embedded Page] Uncaught (in promise) #<Object>
workbench.desktop.main.js:1541 [Embedded Page] Uncaught Error: abort()
3workbench.desktop.main.js:1541 [Embedded Page] Uncaught (in promise) #<Object>

@RandomFractals
Copy link
Owner

@matrix-ranger have you tried it with the light theme?

#250 (comment)

Just set it to that for now, till I find the time to look into those data transfers issues.

I suspect they are related to new changes for byte array transfers:

https://code.visualstudio.com/updates/v1_56#_improved-transfer-of-arraybuffers-to-and-from-webviews

I was hoping vscode v1.56 release would fix it. I did not have time to investigate this further.

There is def. something very odd at the core going on there.

@MatrixRanger98
Copy link

The light themes work well. And btw I am using vscode v1.56.

@RandomFractals
Copy link
Owner

RandomFractals commented May 20, 2021

some devs experiencing this issue reported that prior version of DataPreview v2.2.0 worked.

Please try that version if you run into this issue on your vscode or OS.

You can download it from here: https://marketplace.visualstudio.com/items?itemName=RandomFractalsInc.vscode-data-preview&ssr=false#version-history

Not much changed since that version in 2.3.0. I am still not sure what's causing this.

Could be new WASM loading or other general vscode files reading issues on Darwin OS? #250 (comment)

See them here for more info: https://github.com/microsoft/vscode/issues?q=is%3Aissue+WASM+Darwin

Please report your OS and version, if you run into this.

@RandomFractals
Copy link
Owner

RandomFractals commented May 20, 2021

well, I can confirm that the last published Data Preview v2.3.0 works in vscode v1.56.0 on win7:

image

It also works in Code Spaces. See: RandomFractals/vscode-leaflet#9 (comment)

and in the latest vscode v1.56.2:

image

@mhkeller
Copy link

It works only in the light theme for me with no errors in the dark theme but failing to load.

Version: 1.56.2 (Universal)
Commit: 054a9295330880ed74ceaedda236253b4f39a335
Date: 2021-05-12T17:44:30.902Z
Electron: 12.0.4
Chrome: 89.0.4389.114
Node.js: 14.16.0
V8: 8.9.255.24-electron.0
OS: Darwin x64 19.6.0

@RandomFractals
Copy link
Owner

that's good info. I tested it with @alefragnani last week and we narrowed it down to Darwin OS so far.

Still doesn't explain why switching data preview theme stylesheet would break or fix that data transfer and display.

There are quite a few issues related to extension host reload and wasm in vscode since v1.54.0 release.

I might bite the bullet and update that grid lib and dependencies and bundle this extension to trim it down a bit.

Other than that I am still puzzled by some of those errors.

Thanks for your findings @mhkeller. Much appreciated!

@mhkeller
Copy link

I just learned you can get some more debug output from the >. Here's what I get on dark mode:

> window.WebComponentsReady

 data viewer initialized!

> data size in bytes: 0

> document.readystatechange complete

 data.view:complete!

> loadDataInfo()

 data url: file:///Users/path/to/file.csv
 data table: 

> restoreConfig(
{})

> loadTableList(
 tableNames = []
 requestedDataTable = ''
)

> refresh(dataTable='')

 loading data: file.csv ...

> getData()

 loading file data: file.csv ...

> getData()

 records count: 1,692

> refresh('')

 updating view data: file.csv ...

> 

versus light mode

> window.WebComponentsReady

 data viewer initialized!

> document.readystatechange complete

 data.view:complete!

> loadDataInfo()

 data url: file:///path/to/file.csv
 data table: 

> restoreConfig(
{})

> loadTableList(
 tableNames = []
 requestedDataTable = ''
)

> refresh(dataTable='')

 loading data: file.csv ...

> getData()

 loading file data: file.csv ...

> getData()

 records count: 1,692

> refresh(dataTable='')

 initializing data view: file.csv ...

> viewer.perspective-config-update 

 plugin: hypergrid
 editable: true
 selectable: true
 columns: <columnlist...>
 row-pivots: null
 column-pivots: null
 aggregates: null
 filters: null
 sort: null
 computed-columns: null

> updateStats()

 columns: <columnlist...>
 rows: 1,692

> updateStats()

 columns: <columnlist...>
 rows: 1,692

> 

@RandomFractals
Copy link
Owner

yeah, that provides some debug info. for some reason data is read from file in those blank grid cases, but never makes it to the data preview webview.

@dbofmmbt
Copy link

Hey, this is an awesome extension =) Unfortunately, I'm facing this issue too. Changing to white theme seemed to work.

Maybe the issue should be reopened for visibility? I almost opened one myself because I couldn't find anything related on the open ones.

@RandomFractals RandomFractals removed the wontfix This will not be worked on label May 28, 2021
@RandomFractals
Copy link
Owner

@eduardocanellas I agree. This started with a trickle of random reports and turned into a major issue on Darwin OS now.

I am going to reopen it and wait for vscode v1.57.0 release coming soon that will be using different approach for bytes data transfer.

Please use the light stylesheet for now and ease up on the negative 1 star reviews until we find a solution.

Thanks!

@RandomFractals
Copy link
Owner

so, vscode v1.57.0 is out. Can you try loading Data Preview with the dark theme and that version of vscode to see if this tricky webview data loading issue went away?

@dbofmmbt
Copy link

@RandomFractals Unfortunately, the problem persists here in 1.57.0. With the dark theme enabled, sometimes it works, sometimes it doesn't. FWIW, the light theme has been working great since I enabled it.

@RandomFractals
Copy link
Owner

RandomFractals commented Jun 11, 2021

@eduardocanellas thanks for a quick check.

There is this bit in release notes, but that would only affect arrow data that I transfer via bytes array, and not other data file types.

https://code.visualstudio.com/updates/v1_57#_improved-webview-array-buffer-transfers

I still suspect it's related to wasm and webviews loading on Macs. There are just too many issues open in vscode repo for me to pin it down, and unfortunately I don't have a Mac to test it.

Maybe defaulting to light theme is all we can do for a quick fix and new users trying it on a Mac.

@PierreMarchand20
Copy link
Author

It worked once and then it did not anymore:
Capture d’écran 2021-06-11 à 22 14 38
But it still works with light theme:
image

@dbofmmbt
Copy link

My OS is Linux, by the way. POP OS, to be more precise.

@mhkeller
Copy link

I get the same behavior in dark mode. light mode works fine

> window.WebComponentsReady

 data viewer initialized!

> data size in bytes: 0

> loadDataInfo()

 data url: file:///path/to/data.csv
 data table: 

> restoreConfig(
{})

> loadTableList(
 tableNames = []
 requestedDataTable = ''
)

> refresh(dataTable='')

 loading data:data.csv ...

> getData()

 loading file data: data.csv ...

> getData()

 records count: 1,700

> refresh('')

 updating view data: data.csv ...

> document.readystatechange complete

 data.view:complete!

> 

@RandomFractals
Copy link
Owner

so, yeah, I think I'll change default to light theme next week and maybe see if updating engines to v1.57.0 will fix things for the dark theme.

Thank you guys for trying it again in the latest vscode release v.

@RandomFractals
Copy link
Owner

also, webviews are less than stable once again in the latest release and a lot of devs are hitting webviews not loading issue:

microsoft/vscode#122951

Please be aware of that.

@uditrana
Copy link

uditrana commented Aug 4, 2021

Just chiming in saying this is one of my most favorite extensions but since the regressions a few months ago has become hard to use. I have found light theme to be much more reliable than dark theme.

I am on 2.3.0 for Data Preview and 1.58.2 for VS Code

@RandomFractals
Copy link
Owner

@uditrana yes, please use the light data preview theme. Thanks for chiming in.

@hmccurryWM
Copy link

Chalk another one up for this; I want to look at a comma delimited CSV, but i'm getting the 'Open Data file to Preview' toast. I'm using the light theme, and there are no errors in the dev console.

@RandomFractals
Copy link
Owner

RandomFractals commented Feb 21, 2023

@hmccurryWM try our Tabular Data Viewer from last year. It can load larger CSV files and uses more recent viewer v.:

https://marketplace.visualstudio.com/items?itemName=RandomFractalsInc.tabular-data-viewer

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