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.

I have “node v11.10.0” + MacOS 10.14. Unfortunately I can’t start VK-io because of these errors:

import VK from 'vk-io';
       ^^
SyntaxError: Unexpected identifier

...

import { VK } from 'vk-io';
       ^
SyntaxError: Unexpected token {

So I tried something else but again I’ve not succeed with that approach:

const vk = require('vk-io');
vk.token = "asdfasdfadsf";
const collectStream = vk.collect.wall.get({ owner_id: -86529522 });

// Error:
const collectStream = vk.collect.wall.get({
                                 ^
TypeError: Cannot read property 'wall' of undefined

What do I do wrong?

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
negezorcommented, Feb 24, 2019

The import works only with MJS, TypeScript or Babel preprocessing. Here you need to use Common JS:

const { VK } = require('vk-io');

const vk = new VK();
vk.token = 'asdfasdfadsf';

const collectStream = vk.collect.wall.get({ owner_id: -86529522 });
1reaction
negezorcommented, Feb 27, 2019

The method documentation indicates that it is not available for the group token. Need a service or user token, I already wrote about this above. image

Read more comments on GitHub >

github_iconTop Results From Across the Web

10 Steps to Start Your Business - Small Business Administration
10 steps to start your business. Starting a business involves planning, making key financial decisions, and completing a series of legal activities.
Read more >
How to Start a Business: A Step-by-Step Guide
1. Refine your idea. · 2. Write a business plan. · 3. Assess your finances. · 4. Determine your legal business structure. ·...
Read more >
How to Start a Small Business (Step-by-Step Guide) | ADP
1. You generally have two options when it comes to research – review existing sources or conduct your own analysis. Relying on previously...
Read more >
How To Start A Business In 11 Steps (2022 Guide) - Forbes
1. Determine Your Business Concept · 2. Research Your Competitors and Market · 3. Create Your Business Plan · 4. Choose Your Business...
Read more >
How to Start a Startup in 9 Easy Steps | The Hartford
9 Steps to Help You Start a Startup · 1. Start with a Great Idea · 2. Make a Business Plan · 3....
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