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.

Import not generated

See original GitHub issue

ObjectErrors import ValidationError.

When the projects build is run, the import is not generated. I think it’s because ObjectErrors and ValidationError both reside in the same directory.

If I do not use a paths import, but instead switch it to a relative import, then the build generates the import.

To see the current behavior:

git clone git@github.com:fireflysemantics/validator.git
npm run dist

Look at dist/container/error/ObjectErrors.d.ts. It will be missing the ValidationError import.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:15 (4 by maintainers)

github_iconTop GitHub Comments

6reactions
danielpzacommented, Jul 9, 2019

v1.1.6 is up

1reaction
oleersoycommented, Jul 7, 2019

Before switching over to this plugin I was using a pretty simple script to perform the path translations:

const fs = require("fs");
const globby = require("globby");
const cpy = require("cpy"); 
require("mkdirp").sync("dist");
cpy("package.json", "dist");
cpy("README.md", "dist");
cpy("src/index.ts", "dist");
const options = { overwrite: true };
const rc = require("recursive-copy");
rc("target/src/", "dist", options).then(() => {
  globby("./dist/**/*.js")
    .then(paths => {
      paths.forEach(update);
    })
    .catch(e => console.log(e));

    globby("./dist/**/*.d.ts")
    .then(paths => {
      paths.forEach(update);
    })
    .catch(e => console.log(e));   
});

function update(path) {
  count = (path.match(/\//g) || []).length;
  let replacement = "";
  if (count == 2) {
    replacement = "./";
  } else if (count > 2) {
    const size = count - 2;
    replacement = Array(size)
      .fill("../")
      .join("");
  } else {
    throw new Error("Invalid / count in path of file");
  }
  let js = fs.readFileSync(path, "utf8");
  js = js.replace(/@fs\//g, replacement);
  fs.writeFileSync(path, js);
}

I worked perfectly. Perhaps the algorithm could be incorporated here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"import: not found" when trying to run a Python script
First 10 lines of code from 2nd script: #import mysql.connector import MySQLdb #from MySQLdb import errorcode import os import re ROOT = ...
Read more >
5. The import system — Python 3.11.1 documentation
Python code in one module gains access to the code in another module by the process of importing it. The import statement is...
Read more >
ModuleNotFoundError: no module named Python Error [Fixed]
How to fix the ModuleNotFoundError in Python · 1. Make sure imported modules are installed · 2. Make sure modules are spelled correctly...
Read more >
MSB4019: The imported project 'name' was not found. - MSBuild
This error occurs when MSBuild tries to import a file, but the file couldn't be found. The imported file must be an XML...
Read more >
Data Import error message reference - Analytics Help
Message Meaning So... Empty column header at column number X. The upload file is missing a column header. Ed... Multiple errors occurred: List of multiple...
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