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

Debugger breaks when there's comments in the code #118

Closed
joelgriffith opened this issue Jan 24, 2019 · 4 comments
Closed

Debugger breaks when there's comments in the code #118

joelgriffith opened this issue Jan 24, 2019 · 4 comments
Labels

Comments

@joelgriffith
Copy link
Collaborator

Likely an issue with how we transport code over the wire (part of the URI). Might have to send everything over as a cookie vs stringifying it.

@joelgriffith
Copy link
Collaborator Author

This should be fixed now on latest. Changelog and versioned releases outgoing.

@michwii
Copy link

michwii commented Jan 30, 2019

Thank you !

It still remains a small bug.

When your code exceed a certain size, the code editor does not take into account your modifications.
It takes the last functional version of your code and repeat rendering it.

@michwii
Copy link

michwii commented Jan 31, 2019

Here is an exemple of code :

`module.exports = async ({ page }) => {

var cookies = "";

/**

  • Copyright 2017 Google Inc. All Rights Reserved.
  • Licensed under the Apache License, Version 2.0 (the "License");
  • you may not use this file except in compliance with the License.
  • You may obtain a copy of the License at
  • http://www.apache.org/licenses/LICENSE-2.0
  • Unless required by applicable law or agreed to in writing, software
  • distributed under the License is distributed on an "AS IS" BASIS,
  • WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  • See the License for the specific language governing permissions and
  • limitations under the License.

'use strict';

const fs = require('fs');
const path = require('path');
const jsdoc2md = require('jsdoc-to-markdown');

const inputFiles = ['./src/.js', './src/rich-responses/.js'];
const outputDir = './docs/';

const webhookFilename = 'webhook-client.md';
const webhookClientClassNames = ['WebhookClient', 'V2Agent', 'V1Agent', 'Context'];
const richResponseFilename = 'rich-responses.md'
const richRepsonseClassNames = [ 'RichResponse', 'Card', 'Suggestion', 'Image', 'Payload', 'Text'];

const templateData = jsdoc2md.getTemplateDataSync({files: inputFiles});

let output = ''
for (const className of webhookClientClassNames) {
const template = {{#class name="${className}"}}{{>docs}}{{/class}};
output += jsdoc2md.renderSync({data: templateData, template: template});
fs.writeFileSync(webhookFilename, output);
}

output = ''
for (const className of richRepsonseClassNames) {
const template = {{#class name="${className}"}}{{>docs}}{{/class}};
output += jsdoc2md.renderSync({data: templateData, template: template});
fs.writeFileSync(richResponseFilename, output);
}

exports.rewriteAnchor = function (anchor) {
if (typeof anchor !== 'string') return null;
return anchor.toLowerCase().replace('+', '_');
};

const fs = require('fs');
const path = require('path');
const jsdoc2md = require('jsdoc-to-markdown');

const inputFiles = ['./src/.js', './src/rich-responses/.js'];
const outputDir = './docs/';

const webhookFilename = 'webhook-client.md';
const webhookClientClassNames = ['WebhookClient', 'V2Agent', 'V1Agent', 'Context'];
const richResponseFilename = 'rich-responses.md'
const richRepsonseClassNames = [ 'RichResponse', 'Card', 'Suggestion', 'Image', 'Payload', 'Text'];

const templateData = jsdoc2md.getTemplateDataSync({files: inputFiles});

let output = ''
for (const className of webhookClientClassNames) {
const template = {{#class name="${className}"}}{{>docs}}{{/class}};
output += jsdoc2md.renderSync({data: templateData, template: template});
fs.writeFileSync(webhookFilename, output);
}

output = ''
for (const className of richRepsonseClassNames) {
const template = {{#class name="${className}"}}{{>docs}}{{/class}};
output += jsdoc2md.renderSync({data: templateData, template: template});
fs.writeFileSync(richResponseFilename, output);
}

exports.rewriteAnchor = function (anchor) {
if (typeof anchor !== 'string') return null;
return anchor.toLowerCase().replace('+', '_');
};

const fs = require('fs');
const path = require('path');
const jsdoc2md = require('jsdoc-to-markdown');

const inputFiles = ['./src/.js', './src/rich-responses/.js'];
const outputDir = './docs/';

const webhookFilename = 'webhook-client.md';
const webhookClientClassNames = ['WebhookClient', 'V2Agent', 'V1Agent', 'Context'];
const richResponseFilename = 'rich-responses.md'
const richRepsonseClassNames = [ 'RichResponse', 'Card', 'Suggestion', 'Image', 'Payload', 'Text'];

const templateData = jsdoc2md.getTemplateDataSync({files: inputFiles});

let output = ''
for (const className of webhookClientClassNames) {
const template = {{#class name="${className}"}}{{>docs}}{{/class}};
output += jsdoc2md.renderSync({data: templateData, template: template});
fs.writeFileSync(webhookFilename, output);
}

output = ''
for (const className of richRepsonseClassNames) {
const template = {{#class name="${className}"}}{{>docs}}{{/class}};
output += jsdoc2md.renderSync({data: templateData, template: template});
fs.writeFileSync(richResponseFilename, output);
}

exports.rewriteAnchor = function (anchor) {
if (typeof anchor !== 'string') return null;
return anchor.toLowerCase().replace('+', '_');
};
const fs = require('fs');
const path = require('path');
const jsdoc2md = require('jsdoc-to-markdown');

const inputFiles = ['./src/.js', './src/rich-responses/.js'];
const outputDir = './docs/';

const webhookFilename = 'webhook-client.md';
const webhookClientClassNames = ['WebhookClient', 'V2Agent', 'V1Agent', 'Context'];
const richResponseFilename = 'rich-responses.md'
const richRepsonseClassNames = [ 'RichResponse', 'Card', 'Suggestion', 'Image', 'Payload', 'Text'];

const templateData = jsdoc2md.getTemplateDataSync({files: inputFiles});

let output = ''
for (const className of webhookClientClassNames) {
const template = {{#class name="${className}"}}{{>docs}}{{/class}};
output += jsdoc2md.renderSync({data: templateData, template: template});
fs.writeFileSync(webhookFilename, output);
}

output = ''
for (const className of richRepsonseClassNames) {
const template = {{#class name="${className}"}}{{>docs}}{{/class}};
output += jsdoc2md.renderSync({data: templateData, template: template});
fs.writeFileSync(richResponseFilename, output);
}

exports.rewriteAnchor = function (anchor) {
if (typeof anchor !== 'string') return null;
return anchor.toLowerCase().replace('+', '_');
};
const fs = require('fs');
const path = require('path');
const jsdoc2md = require('jsdoc-to-markdown');

const inputFiles = ['./src/.js', './src/rich-responses/.js'];
const outputDir = './docs/';

const webhookFilename = 'webhook-client.md';
const webhookClientClassNames = ['WebhookClient', 'V2Agent', 'V1Agent', 'Context'];
const richResponseFilename = 'rich-responses.md'
const richRepsonseClassNames = [ 'RichResponse', 'Card', 'Suggestion', 'Image', 'Payload', 'Text'];

const templateData = jsdoc2md.getTemplateDataSync({files: inputFiles});

let output = ''
for (const className of webhookClientClassNames) {
const template = {{#class name="${className}"}}{{>docs}}{{/class}};
output += jsdoc2md.renderSync({data: templateData, template: template});
fs.writeFileSync(webhookFilename, output);
}

output = ''
for (const className of richRepsonseClassNames) {
const template = {{#class name="${className}"}}{{>docs}}{{/class}};
output += jsdoc2md.renderSync({data: templateData, template: template});
fs.writeFileSync(richResponseFilename, output);
}

exports.rewriteAnchor = function (anchor) {
if (typeof anchor !== 'string') return null;
return anchor.toLowerCase().replace('+', '_');
};
*/

try{
var test;
}catch(e){

}

await page.goto('https://www.google.com');
};
`

Try to change the final url, you'll see that it does not work.
It will stays in google.com

Regards

@joelgriffith
Copy link
Collaborator Author

Wow! That’s a large body of code. We’re working towards another way of debugging which I think would fit this use-case better... but might be a bit before it lands. Stay tuned!

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

No branches or pull requests

2 participants