vscode-data-preview
vscode-data-preview copied to clipboard
no preview for csv file
Sorry for the naive question, but I cannot preview a simple csv file:
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 ...
>
@PierreMarchand20 do you see any errors in Help -> Toggle Developer Tools when you run it?
I have this :
Similar to PierreMarchand20
Weirdly enough, toggling Developer Tools and refreshing a few times will occasionally trigger a load of the data.
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.
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.
Exact same error as @PierreMarchand20 and @mrsoftowl over here !
Hi there, as far as I find, the error is caused by the dark theme. Change the theme to light
to fix it temporarily.
Changing theme has no effect on my installation
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.
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.
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.
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
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
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).
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>
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.
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>
Same problem for me too.
VS code Version: 1.54.2 OS: Darwin x64 19.6.0
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.
works with CSV files too. Try Data: Preview Remote data command and paste this data url: https://us-counties.datasette.io/counties/counties.csv
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.
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>
The dark theme actually works once for me (the first time I installed the extension and the first file it opened). Then it won't load data ever again. I disabled all other extensions but nothing happened. Reinstalling vscode does not work either. It at least proved that it could work once in a life time.
@matrix-ranger have you tried it with the light
theme?
https://github.com/RandomFractals/vscode-data-preview/issues/250#issuecomment-787466218
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.
The light themes work well. And btw I am using vscode v1.56.
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? https://github.com/RandomFractals/vscode-data-preview/issues/250#issuecomment-808664190
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.
well, I can confirm that the last published Data Preview v2.3.0 works in vscode v1.56.0 on win7:
It also works in Code Spaces. See: https://github.com/RandomFractals/vscode-leaflet/issues/9#issuecomment-844463639
and in the latest vscode v1.56.2:
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
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!
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
>
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.
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.