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

[beta] D3 : "Identifier 'dataset' has already been declared" error #16087

Closed
PhysRex opened this issue Nov 12, 2017 · 3 comments
Closed

[beta] D3 : "Identifier 'dataset' has already been declared" error #16087

PhysRex opened this issue Nov 12, 2017 · 3 comments
Labels
help wanted Open for all. You do not need permission to work on these. scope: curriculum Lessons, Challenges, Projects and other Curricular Content in curriculum directory.

Comments

@PhysRex
Copy link

PhysRex commented Nov 12, 2017

Challenge Name

https://beta.freecodecamp.org/en/challenges/data-visualization-with-d3/change-styles-based-on-data

Issue Description

Going through the D3 challanges in beta, there are multiple ones that have always show the error "Identifier 'dataset' has already been declared." It appears to be a bug because the solution works if the const dataset line is commented out.

This happened on chrome. I checked and can't reproduce this error in Firefox quantum.

Browser Information

  • Browser Name, Version: Chrome 61.0.3163.100
  • Operating System: Windows 10 Pro
  • Mobile, Desktop, or Tablet: Desktop

Your Code

<body>
  <script>
    const dataset = [12, 31, 22, 17, 25, 18, 29, 14, 9];
    
    d3.select("body").selectAll("h2")
      .data(dataset)
      .enter()
      .append("h2")
      .text((d) => (d + " USD"))
      // Add your code below this line
      
      
      
      // Add your code above this line
  </script>
</body>

Screenshot

screenshot_1

@raisedadead raisedadead changed the title Multiple D3 challanges have "Identifier 'dataset' has already been declared" error [beta] D3 : "Identifier 'dataset' has already been declared" error Dec 6, 2017
@raisedadead raisedadead added scope: curriculum Lessons, Challenges, Projects and other Curricular Content in curriculum directory. help wanted Open for all. You do not need permission to work on these. labels Dec 6, 2017
@onelharrison
Copy link
Contributor

onelharrison commented Dec 9, 2017

I tested this and a few other cases that use const dataset on later versions of Chrome (62 and 63) and got no errors.

@mpontus
Copy link
Contributor

mpontus commented Dec 9, 2017

I believe this issue has been fixed as part of this PR: #16149

Tests are now being executed in a fresh frame, which prevents the collision with the scope from previous run.

@raisedadead
Copy link
Member

Yes, thanks a lot for confirming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Open for all. You do not need permission to work on these. scope: curriculum Lessons, Challenges, Projects and other Curricular Content in curriculum directory.
Projects
None yet
Development

No branches or pull requests

4 participants