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

Can't use extendscript #67

Open
quetslaurent opened this issue Feb 10, 2021 · 0 comments
Open

Can't use extendscript #67

quetslaurent opened this issue Feb 10, 2021 · 0 comments

Comments

@quetslaurent
Copy link

quetslaurent commented Feb 10, 2021

Description

I can't use extend script inside of App.js

Expected behavior

Write hello world in console

Actual behavior

Unhandled Rejection (TypeError): Cannot read property 'evalScript' of undefined

Environment

Run these commands in the project folder and fill in their results:

  1. npm ls create-cep-extension-scripts (if you haven’t ejected): -- [email protected]
  2. node -v: v12.18.4
  3. npm -v: 7.5.3

Then, specify:

  1. Operating system: Windows 10
  2. Browser and version: Google Chrome Version 88.0.4324.150

Reproducible Demo

import React, { Component } from 'react';
import { evalExtendscript } from 'cep-interface';
import logo from './logo.svg';
import './App.css';

class App extends Component {

  test = () => {
    evalExtendscript('$.writeln("Hello Foo");');
  }

  render() {
    return (
      <div className="App">
        <div className="App-header">
          <img src={logo} className="App-logo" alt="logo" />
          <h2>Welcome to React</h2>
        </div>
        <p className="App-intro">
          To get started, edit <code>src/App.js</code> and save to reload.
        </p>
        <button onClick={this.test}>TEST</button>
      </div>
    );
  }
}

export default App;

I got my error : I was trying to use it from react dev server, but I had to use it from PS debug server. It still can't access cep variable for example to read files

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

1 participant